question: private static Element findSingleChildElementByTag ( Element parent , String tag ) throws MissionParseException { Node node = null ; NodeList nodes = parent . getElementsByTagName ( tag ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { node = nodes . item ( i ) ; if ( isElementNode ( node ) ) { break ; } node = null ; } if ( ! tag . equals ( ELEMENT_NEXT_MOMENT ) && node == null ) { throw new MissionParseException ( tag + " could not be found." ) ; } return ( Element ) node ; }
target:  Finds the first occurrence of a child Element of a given tag within a parent's tree.