def __init__(self, dtd=None, doctype=None, lang=None, encoding=DEFAULT_ENCODING):
        if doctype is None and dtd is None:
            raise ValueError("POMDocument: Need one of doctype or dtd parameter.")
        self.dtds = []
        self.root = None
        self.lang = lang
        self.dirty = 0
        self._idmap = {}
        self._COUNTERS = {}
        if doctype: # implies new document
            self.set_doctype(doctype)
        elif dtd:
            self.set_dtd(dtd)
            try:
                root = self.dtd._Root()
            except __HOLE__:
                print("Document warning: unknown root element.", file=sys.stderr)
            else:
                self.set_root(root)
        self.set_encoding(encoding)
        self.set_language(lang)
dataset/ETHPy150Open kdart/pycopia/XML/pycopia/XML/POM.py/POMDocument.__init__