def xpathNextAncestorOrSelf(self, ctxt):
        """Traversal function for the "ancestor-or-self" direction he
          ancestor-or-self axis contains the context node and
          ancestors of the context node in reverse document order;
          thus the context node is the first node on the axis, and
          the context node's parent the second; parent here is
           defined the same as with the parent axis. """
        if ctxt is None: ctxt__o = None
        else: ctxt__o = ctxt._o
        ret = libxml2mod.xmlXPathNextAncestorOrSelf(ctxt__o, self._o)
        if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp