public void replace ( XElement oldChild , XElement newChild ) { int idx = children . indexOf ( oldChild ) ; if ( idx >= 0 ) { children . get ( idx ) . parent = null ; children . set ( idx , newChild ) ; newChild . parent = this ; } }
Replaces the specified child node with the new node . If the old node is not present the method does nothing .