def newDocument(self): """clear DOM""" impl = mdom.getDOMImplementation() self.doc = impl.createDocument(None, self.rootTag, None)