hi

Can anyone tell me how to read XML file?My XML file formate is somehwat like below :

<Root>
<Nodes>
<Node id="1" name="name1" ref="ref1"/>
<Node id="2" name="name2" ref="ref2"/>
</Nodes>
</Root>


How i can read this file? I want to write a function which can give me the value of node. Like ...

String getName("id1") // will return name1

or

String getId("name1") // will return id1

So, depend upnon the value of the node element , it returns the other value of same node.

How i can implement this using JAVA ? Reply ASAP.
Thanks in advance ....