question: static public void removeComments ( Node node ) { NodeList children = node . getChildNodes ( ) ; int i = 0 ; int len = children . getLength ( ) ; while ( i < len ) { Node child = children . item ( i ) ; if ( child . hasChildNodes ( ) ) { removeComments ( child ) ; i ++ ; } else { if ( child . getNodeType ( ) == Node . COMMENT_NODE ) { node . removeChild ( child ) ; len -- ; } else { i ++ ; } } } }
target:  Recursively removes all comment nodes from the subtree.