Generating XML with PHP

Hi guys, I have a fairly simple question for those more familiar with PHP than myself. I’d like to read in a directory structure and write a simple XML file with a node for each file. This would be used for a flash gallery.

Example input:
/images/weddings/file1.jpg
/images/portraits/file2.jpg

Example output:

<gallery path=“images/”>
<image source=“weddings/file1.jpg” />
<image source=“portraits/file2.jpg” />
</gallery>

Super-simple, right? I have enough information on the actual writing of the file, I’m just not sure about how to read in the directory tree with paths intact. Thanks in advance for your pointers :slight_smile: