static List < Node > nodeList2List ( NodeList nl ) { int len = nl . getLength ( ) ; List < Node > l = new ArrayList < Node > ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { Node n = nl . item ( i ) ; if ( ! XMLUnit . getIgnoreComments ( ) || ! ( n instanceof Comment ) ) { l . add ( n ) ; } } return l ; }
Returns the NodeList s Nodes as List taking ignoreComments into account .