I have prepared an implementation (BSD licensed) of QAbstractXmlNodeModel class from QtXmlPatterns module which makes it possible to run QXmlQuery-ies on a QDomDocument. I've called it QDomNodeModel.

Here's an usage example:
Qt Code:
  1.  
  2. doc.setContent(QString("<root><elem someAttr='attrValue'><subElem1 /><subElem2 /></elem></root>"), (QString*) 0, (int*) 0, (int*) 0);
  3.  
  4. QXmlQuery q(QXmlQuery::XQuery10);
  5.  
  6. QDomNodeModel m(q.namePool(), doc);
  7.  
  8. q.setFocus(QXmlItem(m.fromDomNode(doc.documentElement())));
  9.  
  10. q.setQuery("elem/@someAttr");
  11.  
  12. QXmlResultItems res;
  13. q.evaluateTo(&res);
  14.  
  15. while (!res.next().isNull())
  16. {
  17. QDomElement elem = m.toDomNode(res.current().toNodeModelIndex()).toElement();
  18. qDebug() << m.toDomNode(res.current().toNodeModelIndex()).toAttr().value();
  19. }
To copy to clipboard, switch view to plain text mode 

Download link: http://algoholic.eu/wp-content/uploa...demodel.tar.gz