I need to get all values of a particular attribute. The tag name of that attribute might be different and the attribute might be at any level in the xml tree (root level / child level / etc.). Consider the following xml
<?xml version="1.0" encoding="utf-8"?>
<college name ="xyz"/>
<university>
<college name = "abc1" id = "a"/>
<college name = "abc2" id = "b"/>
<sub-univ>
<sub-univ-col name = "sfd"/>
</sub-univ>
</university>
<school name = "asdf"/>enter code here
How do I get the value of "name" attribute from all the xml tags.? XML file which I has much more levels than the example stated above. Is there any way to get the values without parsing at every level?