def detach(self):
if self.up:<EOL><INDENT>self.up.children.remove(self)<EOL>self.up = None<EOL><DEDENT>return self<EOL>
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.