#includeIn this example, we are using TiXmlNode ValueStr to retrieve the value of the first child node of the root element from an XML document. We load the document using TiXmlDocument and then get the root element using FirstChildElement method. We get the first child node using FirstChild method and then use ValueStr method to retrieve its value as a string. Package library - TinyXML.#include "tinyxml.h" using namespace std; int main() { TiXmlDocument doc("sample.xml"); bool loadSuccess = doc.LoadFile(); // loading the XML file if (loadSuccess) { TiXmlElement* rootElement = doc.FirstChildElement(); // getting the root element TiXmlNode* authorNode = rootElement->FirstChild(); // getting the first child node string authorName = authorNode->ValueStr(); // retrieving the value of the node as a string cout << "Author name: " << authorName << endl; } else { cout << "Failed to load XML document" << endl; } return 0; }