I've been searching and searching I did find one class that does this but it only saves it to a file, and it was a bit beyond my talent to rewrite it to send directly to the browser.
What I am trying to do is get an XML document that holds a direcetory structure from a given path.
Surely someone has solved this before and can save me from reinventing the wheel.
Idealy I'm trying to end up with something like
<galleries>
<fun>
<image>image1.jpg</image>
<image>image2.jpg</image>
</fun>
</kids>
<image>kidatplay.jpg</image>
</kids>
<galleries>
where the directory structure is
galleries/fun/image1.jpg
etc.