code: def replaceWith(self, param):
          
          i = self.parent().children().index(self)
          # TODO: transfer the children:
          p = self.parent()
          self.parent().removeChild(self)
          p.insertChild(i, param)
          self = param
docs: replace this parameter with another