PROV-985 Instead of trying to escape every single invalid XML character, use CDATA sections instead.

As it turns out, people sometimes actually use XTHML as field content.
With this fix, the exporter should be able to handle that properly.

While I was at it I reworked the way we do XML pretty printing. We now
rely on DOMDocument to handle that properly and not on some 3rd party
formatting class. In previous PHP versions, DOMDocument failed to
properly format the result on a regular basis but in my limited tests
in PHP5.4+ it actually looks okay-ish.