# XML loading problem

**URL:** <https://forum.kirupa.com/t/xml-loading-problem/306550>\
**Category:** flash\
**Created:** [March 17, 2010, 9:59am UTC](https://forum.kirupa.com/t/xml-loading-problem/306550 "2010-03-17T09:59:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourcesoft](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sourcesoft](https://forum.kirupa.com/u/sourcesoft)\
**Post date:** [March 17, 2010, 9:59am UTC](https://forum.kirupa.com/t/xml-loading-problem/306550/1 "2010-03-17T09:59:28Z")

</div>

hello  
here’s a simple problem for you. I have a XML file:

```auto
<q1>
    <q>question</q>
	<a>a1</q>
	<b>a2</q>
	<c>a3</q>
	<d>a4</q>
</q1>

```

I tried to trace it like this but I’m facing an “undefined” output:

```auto
var my_xml = new XML();
my_xml.onLoad = function(success){
	if (success){
		
        var test=my_xml.firstChild.childNodes;
        trace(test[0]);
	}
	else{
		trace("err");
	}
}
my_xml.load("q.xml");

```

what’s the problem?  
my\_xml.firstChild.childNodes is “\<q1\> and then \<q\>” right?

thx for your time.

edit:I’m using CS4,AS2 compiler. But I can even test it on Flash 8.
