I have a well formed XML document, so that isn't the problem.
There isn't any mystery characters in the document (out of code base) so that isn't the problem.
Why, for elements, would I be getting x spaces and x lines of those spaces at the end of the data?
Sounds like the XML has been formatted for easy reading by a human, introducing extra spaces and line breaks.
Ah, yea - that's the problem.
I am reading an indented XML file.
It appears to find an element, and start reading in blanks until the start of the next element.
Any ideas how to prevent this?
Using the trim() so simplified the code and understanding where the extra data was coming from were the indentions in the file. We are good to go!