# \[Q\] get data in XML

**URL:** <https://forum.kirupa.com/t/q-get-data-in-xml/228977>\
**Category:** flash\
**Created:** [June 13, 2007, 2:41am UTC](https://forum.kirupa.com/t/q-get-data-in-xml/228977 "2007-06-13T02:41:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manfree](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@manfree](https://forum.kirupa.com/u/manfree)\
**Post date:** [June 13, 2007, 2:41am UTC](https://forum.kirupa.com/t/q-get-data-in-xml/228977/1 "2007-06-13T02:41:08Z")

</div>

Hi all, I would like to ask …  
How to retrieve the exact XML data in AS3 ??

here is the XML set

```auto
 
<xml>
 <group>
  <id>1</id>
  <item>Item A</item>
 </group>
 <group>
  <id>2</id>
  <item>Item B</item>
 </group>
</xml>

```

```auto
 
var vReq:URLRequest = new URLRequest("theList.xml");
var ldr:URLLoader = new URLLoader(vReq);
ldr.addEventListener(Event.COMPLETE, onXMLLoaded);
function onXMLLoaded(e:Event):void {
 var xDoc:XMLDocument = new XMLDocument();
 xDoc.ignoreWhite = true;
 var vTrack:XML = new XML(ldr.data);
 xDoc.parseXML(vTrack.toXMLString());
 var vTotalTrack:Number = xDoc.firstChild.childNodes.length;
 for (var i=0; i < vTotalTrack; i++) {
  trace(xDoc.firstChild.childNodes*.childNodes[0]);
  trace(xDoc.firstChild.childNodes*.childNodes[1]);
 }
}

```

the output is :  
\<id\>1\</id\>  
\<item\>item A\</otem\>  
\<id\>2\</td\>  
\<item\>item B\</item\>

I have tried the  
xDoc.firstChild.childNodes\*.childNodes[0].value  
xDoc.firstChild.childNodes\*.childNodes[0].data  
but it doesn’t work …

i just want the output :  
1  
item A  
2  
item B

anybody could help ??  
Thanks
