def newDocNode(self, doc, name, content):
        """Creation of a new node element within a document. @ns and
          @content are optional (None). NOTE: @content is supposed to
          be a piece of XML CDATA, so it allow entities references,
          but XML special chars need to be escaped first by using
          xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
           don't need entities support. """
        if doc is None: doc__o = None
        else: doc__o = doc._o
        ret = libxml2mod.xmlNewDocNode(doc__o, self._o, name, content)
        if ret is None:raise treeError('xmlNewDocNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp