I'm sorry, my question wasn't worded in the most clear manner. For example, if I had this:
<Root>
<Element attr1 = "value1" attr2 = "value2"/>
<Element attr1 = "anothervalue1" attr2 = "anothervalue2"/>
</Root>
and I wanted to search for the element that had the attr2 attribute value of "value2" and need to return the value of the attr1 attribute. Can you do this in Java? I'm not sure if this is more clear. I hope so.