code: def _ancestors_or_self(
              self, qname: Union[QualName, bool] = None) -> List[InstanceNode]:
          
          res = [] if qname and self.qual_name != qname else [self]
          return res + self.up()._ancestors(qname)
docs: XPath - return the list of receiver's ancestors including itself.