Grabbing Confluence markup from an XML export

As part of a slow migration from Confluence to FosWiki, I had to grab the Confluence markup from an XML dump. I found a Python script to do this, but I think the XML format must have changed in the meantime; the script was unable to grab the body content.

I've lashed together a version available here that works with Confluence 2.10 and Python 2.5 . Now to convert the pages to Foswiki markup...

Ack! Just discovered this updated script in the comments section. Looks like that one grabs a lot more than this does (labels, attachments). Oh well, I needed the practice with Python.