[Serializer] Added encoding support for DomDocument in XmlEncoder