I don't know the XDocument API as I do not practice C#, but from my own experience with others languages you are probably right when you are suspecting the '\t' and '\n'.
I tried to load and parse your xml file with tinyxml in C++, but I did not get any error. However, there is two solutions that come to my mind. You could try the following options:
- Use the CDATA element as the text inside a CDATA section will be ignored by the parser.
- Use a trim function to remove the white spaces and line breaks.