Made the doc deserializer generate the same output that the original had.
In particular, HTML doc for XML now preserves the HTML content and in both it honors the format attribute.