public static void createOldLanguageFile(Language lang, File file)
			throws IOException, LanguageNotFoundException {

		LanguageService languageService = DefaultLanguageService.getLanguageService();
		if (lang instanceof OldLanguage) {
			throw new LanguageNotFoundException(
				"Can't create an Old Language file from an OldLanguage");
		}
		LanguageDescription languageDescription =
			languageService.getLanguageDescription(lang.getLanguageID());
		Element root = new Element("language");
		root.setAttribute("version", Integer.toString(lang.getVersion()));
		root.setAttribute("endian", lang.isBigEndian() ? "big" : "little");
		root.addContent(getDescriptionElement(languageDescription));

		for (CompilerSpecDescription cs : lang.getCompatibleCompilerSpecDescriptions()) {
			Element compilerElement = new Element("compiler");
			compilerElement.setAttribute("name", cs.getCompilerSpecName());
			compilerElement.setAttribute("id", cs.getCompilerSpecID().getIdAsString());
			root.addContent(compilerElement);
		}

		root.addContent(getSpacesElement(lang));
		root.addContent(getRegistersElement(lang));

		Document doc = new Document(root);
		FileOutputStream out = new FileOutputStream(file);
		XMLOutputter xml = new GenericXMLOutputter();
		xml.output(doc, out);
		out.close();
	}
Create old-language file for the specified language.
@param lang language
@param file output file
@throws IOException if file error occurs
@throws LanguageNotFoundException if lang is unknown to DefaultLanguageService
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/OldLanguageFactory.java