private void exportExtension() {
		CompilerElement compilerElement = getSelectedCompilerElement();
		if (compilerElement == null) {
			return;
		}
		if (!compilerElement.isExisting()) {
			return;		// Only export existing elements
		}
		String suggestedName = compilerElement.name + PREFERENCES_FILE_EXTENSION;
		File outputFile = getFileFromUser(suggestedName);
		if (outputFile == null) {
			return;
		}
		if (outputFile.exists()) {
			int userChoice = OptionDialog.showYesNoDialog(this, "File exists.",
				"Overwrite " + outputFile.getName() + " ?");
			if (userChoice != OptionDialog.OPTION_ONE) {
				return;
			}
		}
		FileWriter writer = null;
		try {
			String exportString = getXmlString(compilerElement);
			writer = new FileWriter(outputFile);
			writer.write(exportString);
			writer.close();
		}
		catch (IOException ex) {
			Msg.showError(this, this, "Export Failure",
				"Failed to write to file: " + ex.getMessage());
		}
	}
Present a file chooser, then
   - Load the file as a String
   - Test the validity of the file as an XML document describing an extension
   - Create a new CompilerElement representing the extension OR
   - Mark an existing CompilerElement as being overwritten with the new document
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SpecExtensionPanel.java