Also here is what it actually does in the Entity.cpp file that inherits from the XML base class. (NOTE: not all of the code in Entity.cpp) Entity.cpp is connected to Entity.h which inherits from XMLSerializable.h
I'm sorta shooting in the dark here, so apologies in advance.
As far as dumpObject goes, it appears you are tied into cout, if you are allowed to change the code, maybe add an ofstream member, initalise it with ofstream::open (outputFileName) and use it instead of cout.
Although it souds to me like dumpObject is intended to be a debug tool and functions:
outputXML writes 2 lines ("<?xml version=\"1.0\" encoding = \"utf-8\"?>" and "<World>") to the ostream& it's given, then repeatedly calls dumpObject, which calls dumpObjectData, which both ultimately write to cout.
My understanding was that you want that output in your user supplied output file instead of on cout