That's a well-formed document. Those are "user" elements with "id" attributes.
(So searching for a "user id" element is the incorrect part.)
Joined: May 12, 2011
I am actually planning to sort the id values by populating them in a TreeSet. But I am not able to do it this way. Is there anything wrong with using the getElementsByTagName() method? I tried using just "id" but that doesnt work either. Is there any other approach to get the id value?
It would help if you spent a few minutes learning about XML, so that for example you could tell the difference between an element and an attribute. (Here's a good on-line book to start with: http://www.cafeconleche.org/books/xmljava/.) If you don't even know that much then trying to write code is not going to be practical.
Hopefully after you have done that you will understand what you are looking for in your document and be able to figure out how to find it. Right now you are just programming by making guesses, which isn't a practical method either.