I usually write my user documentation using DocBook. For my recent applications built on top of Qt (e.g. PaletteWB (www.palettewb.com)), I needed something that generates in-app help pages. db2qthelp does this.<p>Any criticism or interest is appreciated.
I suggest using XSLT to transform Docbook to other XML. It’s purpose-built for that task. Saxonica offers a Python plug-in, though truth is that the XSLT solution can do everything you need.