Loading Images from XML (Flash CS3)

Hey all! I’m not an AS veteran, so I’m looking for someone to help me out with this directly in the thread (not point me to another url). Any help would be awesome!

My xml structure is like this…

<photogallery>

&lt;image caption="" url="pic1.jpg"&gt;&lt;/image&gt;

&lt;image caption="" url="pic2.jpg"&gt;&lt;/image&gt;

</photogallery>

Since I’m teaching myself how to do this from scratch, I’m starting with something “simple” and then working my way up, so the first thing I wanted to do was just display the list of images (not the images themselves, the text list). The code I’ve written so far is this…

var gallery = new XML();
gallery.load('gallery.xml');
gallery.ignoreWhite(true);
gallery.onLoad = function(success){
	if (success){
		trace("You got it, homey!");
		showphotos(gallery);
	}
	else{ 
	trace("You failed, sucka!");
	}
}

function showphotos(gallery){
	piclist = gallery.childNodes;
	for (var i=0; i<piclist.length; i++){
	portfolio = piclist*;
	trace(portfolio);
	}
}

This is where my questions start.

Since the xml document is the parent, I thought that if I just used .childNodes, it would display everything in the xml file, which it did, but then I assumed from there, if I were to instead use .firstChild.childNodes it would display only the list of images and not include the <photogallery> tags. Instead, it just prints nothing (other than my homey message, that is lol).

So my first question is, what should I have written to get it to print just the image list or will it always include the parent tags when tracing it out?