My guess is since Godot doesn't know anything about XmlDocument, it breaks when you try to use it as a resource. You can't really mix Godot types with external types. You probably need to open the file with Godot's File class to read its contents and pass the data to the C# classes.