use nextSibling();

here an example from the docs:

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.  
  12. QDomElement docElem = doc.documentElement();
  13.  
  14. QDomNode n = docElem.firstChild();
  15. while(!n.isNull()) {
  16. QDomElement e = n.toElement();
  17. if(!e.isNull()) {
  18. cout << qPrintable(e.text()) << endl;
  19. }
  20. n = n.nextSibling();
  21. }
To copy to clipboard, switch view to plain text mode