First thing to check is if the database itself can generate an XML export.

If not you need to run queries and use Qt's XML classes to created XML, e.g. QXmlStreamWriter.

Cheers,
_