/* Using the Qt library's XML parser. */ #include #include #include int main() { QDomDocument doc; doc.setContent( QObject::tr( "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "")); QDomElement n = doc.documentElement().firstChildElement("Student"); while(!n.isNull()) { std::cout << qPrintable(n.attribute("Name")) << std::endl; n = n.nextSiblingElement(); } return 0; }