Maybe you can use an XQuery see http://doc.qt.nokia.com/4.7-snapshot/qxmlquery.html. If you document is not valid XML, it might be even better to parse it via a reg-exp and extract the required information.
XQuery adds some complexity to your project, as you need to understand it first ;-) Here is a tutorial: http://www.w3schools.com/xquery/default.asp.
Good luck!
Bookmarks