Fix writing xml prolog.
Writing xml prolog was broken since upgrade to tinyxml2
Fix xml stuff after upgrade to tinyxml2