UTF8 strings in XML

Whats the easiest way to create an XML document that can contain UTF characters such a or , or potentially problematic characters such as newline
and keep the text readable?

I have in the past used encodebase64 for my internal formats, but if I am creating a publicly viewable format, is there some setting I can use to ensure that the XML.tostring generates a human readable output?

Is there an issue with XMLDocument?

Make sure the doctype line has right encoding matching the encoding of your string.

Well, I’m pretty sure (gonna have to check) that I lost accented characters writing and reading wthout wrapping the text or using encode.

I’ll run some small tests.

Hmm… seems to work out of the box.
Even with endofline characters.
I wonder why I ran into problems a few years back…