public static Element getChild ( Element root , String name ) { if ( null == root ) { return null ; } NodeList list = root . getElementsByTagName ( name ) ; int n = list . getLength ( ) ; if ( n < 1 ) { return null ; } return ( Element ) list . item ( 0 ) ; }
Return a named child relative to a supplied element .