This may be a bug with the JAXB Unmarshaller. The whitespace and newlines are being preserved in the initial saved XML file, but are absent after the file is unmarshalled to Java objects. It's like the unmarshaller is treating all xs:string types as xs:normalizedString types and collapsing newlines and whitespace characters when the default behavior should be to leave them be.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This may be a bug with the JAXB Unmarshaller. The whitespace and newlines are being preserved in the initial saved XML file, but are absent after the file is unmarshalled to Java objects. It's like the unmarshaller is treating all xs:string types as xs:normalizedString types and collapsing newlines and whitespace characters when the default behavior should be to leave them be.