My only suggestion would be to take the dataset, strip trailing slashes, and then sort it. The sorted data will appear in the same order as an html folder hierarchy, and printing it out should be fairly easy.
Comment on Re: Dynamically creating a folder hierarchy