private Element getChildElement ( Element parent ) { NodeList list = parent . getChildNodes ( ) ; int len = list . getLength ( ) ; for ( int i = 0 ; i < len ; i ++ ) { Node node = list . item ( i ) ; if ( node instanceof Element ) { return ( Element ) node ; } } return null ; }
return fitst child Element of a Element if there are no child Elements return null