private static Element getFirstChildElement ( Node parent ) { NodeList nodeList = parent . getChildNodes ( ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { Node node = nodeList . item ( i ) ; if ( node instanceof Element ) { return ( Element ) node ; } } return null ; }
Gets the first child element of a node .