Integrate XML in the photogallery script

Hey I’m currently playing around with the http://www.kirupa.com/developer/mx/photogallery.htm tutorial wich i think is great. Right now i’m modifying it in my way and i would like some easier way for the script to load the images.

The best way though i don’t know if this is possible would be if the script could automaticly load all the images in the folder

this.pathToPics = "animation/";

Instead of having to edit the .fla every time you have a new picture.

Another way I could do it is to have an XML file where the images are listed and then i can load the XML file in the pArray. Example:

this.pArray = _root.theimages;

How do I do this?