XML question

Hello guys!
I have the following xml file:

<?xml version="1.0" encoding="UTF-8"?>
    <images>
      <pic>
        <image>kingston/king01.jpg</image>
        <caption>The first image!</caption>
      </pic>
      <pic>
        <image>kingston/king02.jpg</image>
        <caption>The second image</caption>
      </pic>
      <pic>
        <image>kingston/king03.jpg</image>
        <caption>The third image</caption>
      </pic>
    </images>

And below is my script:

var testXml:XML = new XML();
testXml.ignoreWhite = true;
testXml.load("photos.xml");
testXml.onLoad = function(success) {
    if (success) {
        var k = this.firstChild.firstChild.childNodes*.childNodes[0];
        for (var i:Number = 0; i<this.firstChild.childNodes.length; i++) {
            duplicateMovieClip(emp, "king"+i, this.getNextHighestDepth());
            var e = eval("king"+i);
            e._x = e._width;
        }
        loadMovie(k, e);
    }
};

I know that it contains errors, I need to load the images that are in kingstone folder, and i need to place them next to each other. how can i do that?
another question, is there a way to load the images in a certain folder, that counts the files and loads them? i mean if the clients uploads some images from in kingstone folder can i count the images and load them?

thanks in advance
Rony