You don't need to worry about well-formedness rules
Pretty printing is almost automatic.
You can pick any encoding Java supports.
Validity is not automatically maintained.