Added the start of flush(). Inserted a code block that creates the root of
an XML DOM tree.