code: def detach(self):
          
          if self.up:
              self.up.children.remove(self)
              self.up = None
          return self
docs: Detachs this node (and all its descendants) from its parent
          and returns the referent to itself.
  
          Detached node conserves all its structure of descendants, and can
          be attached to another node through the 'add_child' function. This
          mechanism can be seen as a cut and paste.