The QDom classes are typically used as follows:

Qt Code:
  1. QDomDocument doc("mydocument");
  2. QFile file("mydocument.xml");
  3. if (!file.open(QIODevice::ReadOnly))
  4. return;
  5. if (!doc.setContent(&file)) {
  6. file.close();
  7. return;
  8. }
  9. file.close();
  10.  
  11. // print out the element names of all elements that are direct children
  12. // of the outermost element.
  13. QDomElement docElem = doc.documentElement();
  14.  
  15. QDomNode n = docElem.firstChild();
  16. while(!n.isNull()) {
  17. QDomElement e = n.toElement(); // try to convert the node to an element.
  18. if(!e.isNull()) {
  19. cout << e.tagName() << endl; // the node really is an element.
  20. }
  21. n = n.nextSibling();
  22. }
To copy to clipboard, switch view to plain text mode 
More information:
QDomDocument