Originally posted by rathi ji:
But the problem is when any element has attributes , how can I convert that type of XML file into Map ?
<customer id="5">
<name>john</name>
<surname>rite</surname>
</customer>
How the Map will be ?
If you really must convert a hierarchical XML document into a flat key-value structure, this is how I would probably encode attributes: