code: def next_position(self, pos):
          
          candidate = None
          if pos is not None:
              candidate = self.first_child_position(pos)
              if candidate is None:
                  candidate = self.next_sibling_position(pos)
                  if candidate is None:
                      candidate = self._next_of_kin(pos)
          return candidate
docs: returns the next position in depth-first order