private void parseRecord(Element unitNode){
  NodeList nl=unitNode.getChildNodes();
  for (int i=0; i < nl.getLength(); i++) {
    Node currNode=nl.item(i);
    if (currNode.getParentNode() != unitNode) {
      continue;
    }
    int nodeType=currNode.getNodeType();
    if (nodeType == Node.ELEMENT_NODE) {
      String nodeName=currNode.getNodeName();
      if (nodeName.equalsIgnoreCase(UNIT)) {
        parseUnit((Element)currNode,entities);
      }
 else       if (nodeName.equalsIgnoreCase(SURVIVORS)) {
        parseUnit((Element)currNode,survivors);
      }
 else       if (nodeName.equalsIgnoreCase(ALLIES)) {
        parseUnit((Element)currNode,allies);
      }
 else       if (nodeName.equalsIgnoreCase(SALVAGE)) {
        parseUnit((Element)currNode,salvage);
      }
 else       if (nodeName.equalsIgnoreCase(DEVASTATED)) {
        parseUnit((Element)currNode,devastated);
      }
 else       if (nodeName.equalsIgnoreCase(KILLS)) {
        parseKills((Element)currNode);
      }
 else       if (nodeName.equalsIgnoreCase(ENTITY)) {
        parseUnit((Element)currNode,entities);
      }
 else       if (nodeName.equalsIgnoreCase(PILOT)) {
        parsePilot((Element)currNode);
      }
    }
 else {
      continue;
    }
  }
}

private void parseRecord ( Element unitNode ) { NodeList nl = unitNode . getChildNodes ( ) ; for ( int i = 0 ; i < nl . getLength ( ) ; i ++ ) { Node currNode = nl . item ( i ) ; if ( currNode . getParentNode ( ) != unitNode ) { continue ; } int nodeType = currNode . getNodeType ( ) ; if ( nodeType == Node . ELEMENT_NODE ) { String nodeName = currNode . getNodeName ( ) ; if ( nodeName . equalsIgnoreCase ( UNIT ) ) { parseUnit ( ( Element ) currNode , entities ) ; } else if ( nodeName . equalsIgnoreCase ( SURVIVORS ) ) { parseUnit ( ( Element ) currNode , survivors ) ; } else if ( nodeName . equalsIgnoreCase ( ALLIES ) ) { parseUnit ( ( Element ) currNode , allies ) ; } else if ( nodeName . equalsIgnoreCase ( SALVAGE ) ) { parseUnit ( ( Element ) currNode , salvage ) ; } else if ( nodeName . equalsIgnoreCase ( DEVASTATED ) ) { parseUnit ( ( Element ) currNode , devastated ) ; } else if ( nodeName . equalsIgnoreCase ( KILLS ) ) { parseKills ( ( Element ) currNode ) ; } else if ( nodeName . equalsIgnoreCase ( ENTITY ) ) { parseUnit ( ( Element ) currNode , entities ) ; } else if ( nodeName . equalsIgnoreCase ( PILOT ) ) { parsePilot ( ( Element ) currNode ) ; } } else { continue ; } } }
parse a unit tag . unit tags will contain a list of entity tags .
