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;
}

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 ; }
finds the first occurrence of a child element of a given tag within a parent ' s tree .
