Suppose you've been backing up your hard drive to discs using K3b. Suppose you've been saving off each disc as a K3b project, and writing just the project name on the disc. Now suppose you want to get at the list of files in each of those projects (so you can eventually create a complete index for all those discs). You'd be just like me today ;-).
Luckily for you K3b project files are just zip-compressed archives with a couple xml files in there. One file is called maindata.xml, it has an xml representation of the directory structure of the disc with all the filenames along with some other stuff I'm not interested in today. I wanted an easy bash script to get the maindata.xml file out of each project and save it with the name of the K3b project (minus the extension).
What worked for me was this:
Hi Rob, I found your post helpful to start me off, but I also wanted to list the track details. I ended up doing with with an XSLT stylesheet - details here if you're interested: