output.write(entity.getModel());
output.write(entity.getModel().replaceAll("\"", "&quot;"));
    public static void saveTo(File file, Vector list)            throws IOException {        /*        ** The MS JVM can't handle UTF-8 files.  MS says "don't use them".        ** TODO: restore UTF-8 after upgrade to more recent jre.        **        // Open up the file.  Produce UTF-8 output.        Writer output = new BufferedWriter( new OutputStreamWriter            ( new FileOutputStream( new File( filePath, fileName ) ),                                    "UTF-8" )            );        // Output the doctype and header stuff.        output.write( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" );        */        // Open up the file.        Writer output = new BufferedWriter(new OutputStreamWriter                (new FileOutputStream(file)));        // Output the doctype and header stuff.        output.write("<?xml version=\"1.0\"?>");        output.write(CommonConstants.NL);        output.write(CommonConstants.NL);        output.write("<unit>");        output.write(CommonConstants.NL);        output.write(CommonConstants.NL);        // Walk through the list of entities.        Enumeration items = list.elements();        while (items.hasMoreElements()) {            final Entity entity = (Entity) items.nextElement();            // Start writing this entity to the file.            output.write("   <entity chassis=\"");            output.write(entity.getChassis());            output.write("\" model=\"");            output.write(entity.getModel());            output.write("\" type=\"");            output.write(entity.getMovementModeAsString());            output.write("\">");            output.write(CommonConstants.NL);            // Add the crew this entity.            final Pilot crew = entity.getCrew();            output.write("      <pilot name=\"");            output.write(crew.getName());            output.write("\" gunnery=\"");            output.write(String.valueOf(crew.getGunnery()));            output.write("\" piloting=\"");            output.write(String.valueOf(crew.getPiloting()));            if (crew.isDead() || crew.getHits() > 5) {                output.write("\" hits=\"Dead");            } else if (crew.getHits() > 0) {                output.write("\" hits=\"");                output.write(String.valueOf(crew.getHits()));            }            if (crew.countAdvantages() > 0) {                output.write("\" advantages=\"");                output.write(String.valueOf(crew.getAdvantageList("::")));            }            if (entity instanceof Mech) {                if (((Mech) entity).isAutoEject()) {                    output.write("\" autoeject=\"true");                } else {                    output.write("\" autoeject=\"false");                }            }            output.write("\"/>");            output.write(CommonConstants.NL);            // If it's a tank, add a movement tag.            if (entity instanceof Tank) {                Tank tentity = (Tank) entity;                output.write(getMovementString(tentity));                if (tentity.isTurretLocked())                    output.write(getTurretLockedString(tentity));            }            // Add the locations of this entity (if any are needed).            String loc = getLocString(entity);            if (null != loc) {                output.write(loc);            }            // Finish writing this entity to the file.            output.write("   </entity>");            output.write(CommonConstants.NL);            output.write(CommonConstants.NL);        } // Handle the next entity        // Finish writing.        output.write("</unit>");        output.write(CommonConstants.NL);        output.flush();        output.close();    }