code: def _next_of_kin(self, pos):
          
          candidate = None
          parent = self.parent_position(pos)
          if parent is not None:
              candidate = self.next_sibling_position(parent)
              if candidate is None:
                  candidate = self._next_of_kin(parent)
          return candidate
docs: looks up the next sibling of the closest ancestor with not-None next
          siblings.