Preserve whitespace during XML serialization

Convert whitespace characters (other than spaces) to their respective character entities during XML serialization.

http://manage.dimagi.com/default.asp?109032