How to prevent FXmlNode children from GC removal?

I am reading an Xml File

if (FPaths::FileExists(xmlPath))
    FXmlFile file(xmlPath);
    rootNode = file.GetRootNode();

Where rootNode is a member of the current class/object.
Within the ifbranch, everything works fine, but as soon as I leave the if branch, the children of rootNode are gone, I presume the garbage collector removed them. How can I prevent this?


I have rewritten my class to inherit from UObject and use the rootNode as a UPROPERTY and the problem still remains.