I try to parse a XML-file with the following structure:
you could use QXmlQuery. It act like XQuery (i guess the syntax is the same). And you could parse your xml file with the big advantage of XQuery's flexibility. You can start with a code like this:
QByteArray myDocument;
QBuffer buffer(&myDocument); // This is a QIODevice.
buffer.open(QIODevice::ReadOnly);
QXmlQuery query;
query.bindVariable("myDocument", &buffer);
query.setQuery("doc($myDocument)");
setQuery method allow you to define your search pattern. It can be based on element id, attribute, and so on...as with XQuery. This is QXmlQuery doc page: link