Load and read XML file

I am new in c++ in UE4 and i want to load XML file and read it at run time. Is this possible in UE4. If it is possible, is there tutorial or can anyone please help and explain how to do it. I tried this for txt file and it works but for xml i spent lot of time and no succes. Thanks alot.

You can read XmlParser | Unreal Engine Documentation They have included all the necessary functions

Reviving this because I was searching for the same information for a UE5 project and found the XmlParser doc hard to get started with.

Here’s a small sample that’s working in UE5.1 for me (hope it helps/please let me know if I’m doing this wrong):

FString FilePath(TEXT("C:/abc/xyz.xml"));

FXmlFile MyXml(FilePath, EConstructMethod::ConstructFromFile);

if (MyXml.GetRootNode())
{
    const FXmlNode* RootNode = MyXml.GetRootNode();

    const FString MyChildTag("ChildTag");
    const FXmlNode* MyChildNode = RootNode->FindChildNode(MyChildTag);
}

You can continue getting XML nodes/attributes/content using the above functions/other functions of the FXmlFile class and FXmlNode class and then load into a struct/class/etc depending on what you need to do.

Make sure to include all the necessary headers – for the example above:

#include "XmlFile.h"
#include "XmlNode.h"

Lastly, look into IFileManager if you need to work with file paths to the XML file.