#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <iostream>
#include <string>
int main() {
using boost::property_tree::ptree;
ptree pt;
std::string xml = R"(
<?xml version="1.0" encoding="UTF-8"?>
<result xmlns:xf="http://w...content-available-to-author-only...3.org/2000/xforms">
<interpretation confidence="4" grammar="session:4165613484088130576_ff437140-ce30-46f8-85f9-ac756bfe27cb">
<xf:instance>
<result>
<AskConfirmation>False</AskConfirmation>
<address>undefined</address>
<entityid>361659</entityid>
<isleaf>1</isleaf>
<name>Madame Véronique ABONDANCE</name>
<originalid>1677</originalid>
<parentid>361656</parentid>
<recognitionAttemptNumber>2</recognitionAttemptNumber>
<recognitionThresholdMax>65</recognitionThresholdMax>
<recognitionThresholdMin>50</recognitionThresholdMin>
<recognizedword>ABONDANCEVéronique</recognizedword>
<routingNumberOnNonRecognition>6302</routingNumberOnNonRecognition>
<transfertnumber1>2614</transfertnumber1>
<transfertnumber2>undefined</transfertnumber2>
<transfertnumber3>undefined</transfertnumber3>
<wavefile>TTS_fr-FR_9DFDE757EF8CC42956D78B159D259932.wav</wavefile>
</result>
</xf:instance>
<input mode="speech">ABONDANCE</input>
</interpretation>
</result>
)";
std::stringstream ss(xml);
read_xml(ss, pt);
int confidence = pt.get<int>("result.interpretation.<xmlattr>.confidence");
std::string name = pt.get<std::string>("result.interpretation.xf:instance.result.name");
std::cout << "Confidence: " << confidence << std::endl;
std::cout << "Name: " << name << std::endl;
return 0;
}