Space, carriage return, linefeed, and tab and considered "whitespace" in the syntax of XML tags, you can't simply put those characters in strings between tags.
If you are trying to put these characters in the data you are representing in an XML document, you can put it between
<![CDATA[
and
]]>
markers, e.g.,
<![CDATA[
This data is not parsed.
]]>
There may be other choices, but that depends on what software is reading the XML file for what purpose. You'd have to observe the encoding rules of
that application.