question: private synchronized static void removeChildCharacterData ( Node node , boolean deep ) { NodeList list = node . getChildNodes ( ) ; for ( int i = list . getLength ( ) ; i >= 0 ; i -- ) { Node n = list . item ( i ) ; if ( n == null ) continue ; if ( n instanceof CharacterData ) node . removeChild ( XMLCaster . toRawNode ( n ) ) ; else if ( deep ) removeChildCharacterData ( n , deep ) ; } }
target:  remove children from type CharacterData from a node, this includes Text,Comment and CDataSection nodes