To write a DOM Document object
to a file in XML form, first import a method like this:
import Ft.Xml.Domlette as domlette
There are two different serializing (printing) methods.
Use .Print() for correct handling of
indenting and line breaks.
If the output is intended for human consumption, and
you don't mind extra line breaks and indentation added
for legibility, use .PrettyPrint(). Its
arguments are the same as the .Print()
function.
To serialize a document :
D
Then pass the document object to it using this general form:
domlette.Print(D,stream,encoding)
where the optional arguments are:
stream
A file object where you want the XML written. Defaults to standard output.
encoding
The character encoding you want to use. The
default is 'UTF-8'.