private static void doArchive() throws MVDException
	{
		try
		{
			MVD mvd = loadMVD();
			File m = new File( mvdFile );
			File archiveDir;
			XMLGuideFile guideFile = new XMLGuideFile( mvd );
			// create default archive name
			if ( archiveName == null )
			{
				archiveName = m.getName();
				int index = archiveName.lastIndexOf(".");
				archiveName = archiveName.substring( 0, index );
				archiveDir = new File( m.getParentFile(), archiveName );
			}
			else
				archiveDir = new File( archiveName );
			if ( !archiveDir.exists() )
				archiveDir.mkdir();
			int nVersions = mvd.numVersions();
			for ( short i=1;i<=nVersions;i++ )
			{
				char[] data = mvd.getVersion( i );
				// use the short name as the file name
				String vName = mvd.getVersionShortName( i );
				File versionFile = new File( archiveDir, vName );
                FileOutputStream fos = new FileOutputStream( versionFile );
				OutputStreamWriter osw = new OutputStreamWriter( fos, mvd.getEncoding() );
				osw.write( data );
				osw.close();
				guideFile.setVersionFile( i, vName );
			}
			guideFile.externalise( new File(archiveDir,XMLGuideFile.GUIDE_FILE) );
		}
		catch ( Exception e )
		{
			throw new MVDToolException( e );
		}
	}