When creating a new document, the default value of encoding is UTF-16LE. When opening an existing document, the value of encoding is specified in the declaration of the document. If there is no declaration in the document or no value of encoding is specified in the declaration, the value of encoding is UTF-16LE by default. If the value of standalone is an empty string, it will be set to "no" by default. If the value of version is invalid, no declaration will be added. If the value of encoding is invalid, no exception will be thrown, but an empty document will be generated.
dom_document.newdocument("appeon") dom_document.SetXMLDeclaration("1.0","UTF-8","yes") dom_document.SaveDocument("newdocument.xml") //the doc will be saved in UTF-8 format