Loading plain text with leading whitespace

When I try to load text from XML into a text field any leading line breaks or spaces are ignored. For example:

<text>    some text</text>

The preceding loads into the text field without the leading spaces before “some text”. How can I force the spaces to appear?