How to pass flags to RapidXML xml_document::parse()

Use the template argument (<>) like this:

doc.parse<rapidxml::parse_non_destructive>(data);

Full example:

// Create & parse document
xml_document<> doc;
try {
    doc.parse<rapidxml::parse_non_destructive>(data);
} catch(rapidxml::parse_error& ex) {
    cerr << "XML Parse error in " << filename << endl; 
    return;
}