protected static List < Element > getElements ( final Element parent , final String tagName ) { List < Element > elements = new ArrayList < Element > ( ) ; NodeList nodes = parent . getElementsByTagName ( tagName ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { org . w3c . dom . Node node = nodes . item ( i ) ; if ( node instanceof Element ) { elements . add ( Element . class . cast ( node ) ) ; } } return elements ; }
Finds child elements in DOM .