code: def getNextNode(self, name, **context):
          
          try:
              nextNode = self.getBranch(name, **context)
          except (error.NoSuchInstanceError, error.NoSuchObjectError):
              return self.getNextBranch(name, **context)
          else:
              try:
                  return nextNode.getNextNode(name, **context)
              except (error.NoSuchInstanceError, error.NoSuchObjectError):
                  try:
                      return self._vars[self._vars.nextKey(nextNode.name)]
                  except KeyError:
                      raise error.NoSuchObjectError(name=name, idx=context.get('idx'))
docs: Return tree node next to name