The responseTree contains a NodeList (
http://www.w3schools.com/DOM/
dom_nodelist.asp)
You can use the item(index) method on the nodelist to retrieve the
item located at "index"...
For example, using a simple xml file that looks like this:
<?xml version="1.0"?>
<MovieCatalog>
<movie>
<title>The Matrix</title>
<length>136</length>
<genre>Sci-Fi and Fantasy</genre>
<actors>
<actor>Keanu Reeves</actor>
<actor>Laurence Fishburne</actor>
<actor>Carrie Ann Moss</actor>
</actors>
<datereleased>1999</datereleased>
<director>Wachowski Brothers</director>
<format>DVD</format>
</movie>
</MovieCatalog>
The following would allow you to access "MovieCatalog"...
function onCompleteCallback(responseTree) {
responseTree.item(1);
}
Be careful though as this is not a good example: Firefox treats
whitespace and new lines as text nodes while IE doesn't... so you
should test for nodeType to make sure you get elements only...
(nodeType == 1)