# XML trouble

**URL:** <https://forum.kirupa.com/t/xml-trouble/122883>\
**Category:** Uncategorized\
**Created:** [September 17, 2004, 11:06pm UTC](https://forum.kirupa.com/t/xml-trouble/122883 "2004-09-17T23:06:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![UC\_PRO](https://avatars.discourse-cdn.com/v4/letter/u/c68b51/32.png) [@UC\_PRO](https://forum.kirupa.com/u/UC_PRO)\
**Post date:** [September 17, 2004, 11:06pm UTC](https://forum.kirupa.com/t/xml-trouble/122883/1 "2004-09-17T23:06:53Z")

</div>

This what I got so far

[COLOR=Red]\<eqid\>  
\<id1\>  
\<id\>41\</id\>   
\<desc\>TEST\</desc\>  
\<serial\>123456\</serial\>  
\</id1\>  
\</eqid\>[/COLOR]

and the AS that I was trying to do is:

[COLOR=Blue]function loadXML(loaded) {

if (loaded) {

\_root.eqid= this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.desc= this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.serial= this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
id.text = \_root.eqid;  
desc.text = \_root.desc;  
serial.text = \_root.serial;  
} else {  
trace(“file not loaded!”);;

}

}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“structure.xml”);  
[/COLOR]

the problem I think I have is the firstChild directions…please help, I did the tut on your site [http://www.kirupa.com/developer/actionscript/xmldataflash.htm](http://www.kirupa.com/developer/actionscript/xmldataflash.htm)  
and still dont understand the direction from tree to branch…you got in your AS inventor as root and comment as root, that doent make much sense to me. Isnt comment a node instead of a root ?

thanks in advance!
