public void write(String filename){
  logger.info("write carrier plans");
  try {
    openFile(filename);
    writeXmlHead();
    startCarriers(this.writer);
    for (    Carrier carrier : carriers) {
      startCarrier(carrier,this.writer);
      writeVehiclesAndTheirTypes(carrier,this.writer);
      writeShipments(carrier,this.writer);
      writeServices(carrier,this.writer);
      writePlans(carrier,this.writer);
      endCarrier(this.writer);
    }
    endCarriers(this.writer);
    close();
    logger.info("done");
  }
 catch (  IOException e) {
    e.printStackTrace();
    logger.error(e);
    System.exit(1);
  }
}

public void write ( String filename ) { logger . info ( "write carrier plans" ) ; try { openFile ( filename ) ; writeXmlHead ( ) ; startCarriers ( this . writer ) ; for ( Carrier carrier : carriers ) { startCarrier ( carrier , this . writer ) ; writeVehiclesAndTheirTypes ( carrier , this . writer ) ; writeShipments ( carrier , this . writer ) ; writeServices ( carrier , this . writer ) ; writePlans ( carrier , this . writer ) ; endCarrier ( this . writer ) ; } endCarriers ( this . writer ) ; close ( ) ; logger . info ( "done" ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; logger . error ( e ) ; System . exit ( 1 ) ; } }
writes carriers and their plans into a xml - file .
