You should use QXmlQuery: link
From qt docs:
Running an XSLT stylesheet is similar to running XQuery, except that when you create QXmlQuery, you must pass QXmlQuery :: XSLT20 in order to pass QXmlQuery to interpret everything it gets from setQuery () as an XSLT stylesheet, and not as XQuery. You must also set the input document by calling setFocus ().
Code:
QXmlQuery query(QXmlQuery::XSLT20); query.setFocus(QUrl("myInput.xml")); query.setQuery(QUrl("myStylesheet.xsl")); query.evaluateTo(out);
where "out" is the pdf file. and the xsl file determine how to convert your XML file to pdf.
source share