Serialize the parent tree object instead of the root node.
Avoid use of builtin variables.
Log parse errors for failing to parse a single file properly.
Preserve XML comments from which may be present in the original XML document when downgrading.
Set utf-8 encoding if there is no docinfo.encoding parameter available.