public Node replaceNode ( Closure c ) { if ( parent ( ) == null ) { throw new UnsupportedOperationException ( "Replacing the root node is not supported" ) ; } appendNodes ( c ) ; getParentList ( parent ( ) ) . remove ( this ) ; this . setParent ( null ) ; return this ; }
Replaces the current node with nodes defined using builder - style notation via a Closure .