Add methods for writing pre-escaped/XML strings

- Fix doulbe-escape in writeElementString().
Preserve whitespace in serialize/parse round-trip