code: def document(self):
          
          if self.is_document:
              return self
          return self.adapter.wrap_document(self.adapter.impl_document)
docs: :return: the :class:`Document` node that contains this node,
              or ``self`` if this node is the document.