Are you talking about bulding the in-memory tree representation of the XML document?
If you use a DOM Parser and parse the document, it returns you a Document object reference which *is* the DOMTree.
Document document = parser.parse(uri);
Then you can recursively traverse the Document object just like the way you traverse the nodes in a tree data structure.
If my explanation is not clear, I suggest you download the Xerces parser from xml.apache.org and check out the DOMWriter sample program.
Good luck,
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.