question: public static Node removeChildren ( Node node ) { if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { NodeList children = node . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { Node child = children . item ( i ) ; Node temp = node . removeChild ( child ) ; i -- ; } } return node ; }
target:  Removes all the children of a given Node