I do XML serialization for objects with the XmlSerializer. When an object property of type string contains a white space (" "), this value is serialized as insignificant white space:
<tag> </tag>
However, I like to ensure, that this whitespace(s) are kept as significant white spaces. Say, that it would look like:
<tag> </tag>
or:
<tag xml:space="preserve"> </tag>
How can I achieve that with the XmlSerializer?