Enumeration iter;
    public static void encode( Entity entity, Writer out )        throws IOException    {        Enumeration iter; // used when marching through a list of sub-elements        Tank tank = (Tank) entity;        int value;        // First, validate our input.        if ( null == entity ) {            throw new IllegalArgumentException( "The entity is null." );        }        if ( null == out ) {            throw new IllegalArgumentException( "The writer is null." );        }        // Our EntityEncoder already gave us our root element.        out.write( "<hasNoTurret value=\"" );        out.write( tank.hasNoTurret() ? "true" : "false" );        out.write( "\" /><stunnedTurns value=\"" );        value = tank.getStunnedTurns();        out.write( String.valueOf(value) );        out.write( "\" /><jammedTurns value=\"" );        value = tank.getJammedTurns();        out.write( String.valueOf(value) );        out.write( "\" /><moveHit value=\"" );        out.write( tank.isMovementHit() ? "true" : "false" );        out.write( "\" /><moveHitPending value=\"" );        out.write( tank.isMovementHitPending() ? "true" : "false" );        // Is the turret locked?        if ( tank.isTurretLocked() ) {            // Yup.  Record the current facing of the tank and the turret.            out.write( "\" /><facing value=\"" );            value = tank.getFacing();            out.write( String.valueOf(value) );            out.write( "\" /><turretFacing value=\"" );            value = tank.getSecondaryFacing();            out.write( String.valueOf(value) );            out.write( "\" /><turretLocked value=\"true" );        }        out.write( "\" />" );    }