QDomDocument doc; bool isNull = doc.isNull(); // should be true
QFile file("example.xml"); if (!file.open(QIODevice::ReadOnly)) return; QDomDocument doc; if (!doc.setContent(&file)) { file.close(); return; } bool isNull = doc.isNull(); // should be false if XML is valid
#include