Program that generates an xml file for Photo Gallery

I’m looking into a way of making a small program that would look for images within a folder and its subfolders and create an xml file with the name of the file as the picture name, its path, the name of the folder as a category for the pictures and the thumbnail path.
So basically using the same type of format from the kirupa photogallery w/thumbanails:

[[FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT]](file:///C:/Documents%20and%20Settings/susana%20cuneo/Desktop/images.xml#) [COLOR=#0000ff]<[/COLOR][COLOR=#990000]images[/COLOR][COLOR=#0000ff]>[/COLOR]
[[FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT]](file:///C:/Documents%20and%20Settings/susana%20cuneo/Desktop/images.xml#) [COLOR=#0000ff]<[/COLOR][COLOR=#990000]pic[/COLOR][COLOR=#0000ff]>[/COLOR]
[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]image[/COLOR][COLOR=#0000ff]>path of the image[/COLOR][COLOR=#0000ff]</[/COLOR][COLOR=#990000]image[/COLOR][COLOR=#0000ff]>[/COLOR]

[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]caption[/COLOR][COLOR=#0000ff]>[/COLOR]name of the file[COLOR=#0000ff]</[/COLOR][COLOR=#990000]caption[/COLOR][COLOR=#0000ff]>[/COLOR]

[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT] [COLOR=#0000ff]<[/COLOR][COLOR=#990000]category[/COLOR][COLOR=#0000ff]>[/COLOR]name of the folder[COLOR=#0000ff]</[/COLOR][COLOR=#990000][COLOR=#990000]category[/COLOR][/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff]<[/COLOR][COLOR=#990000]thumbnail[/COLOR][COLOR=#0000ff]>path of the thumbnail[/COLOR][COLOR=#0000ff]</[/COLOR][COLOR=#990000]thumbnail[/COLOR][COLOR=#0000ff]>[/COLOR]

[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT] [COLOR=#0000ff]</[/COLOR][COLOR=#990000]pic[/COLOR][COLOR=#0000ff]>[/COLOR]
[COLOR=#0000ff][/COLOR]
[COLOR=#0000ff]thanks a lot Fernando.[/COLOR]