private void importExtension() {
		if (!program.hasExclusiveAccess()) {
			Msg.showError(this, this, "Import Failure",
				"Must have an exclusive checkout to import a new extension");
			return;
		}
		File file = getFileFromUser(null);
		if (file == null) {
			return;
		}
		String document;
		DocInfo docInfo = null;
		Exception errMessage = null;
		try {
			document = fileToString(file).trim();
			docInfo = specExtension.testExtensionDocument(document);
			int pos = findMatch(docInfo.getType(), docInfo.getFormalName());
			Status status = Status.EXTENSION_INSTALL;
			if (pos >= 0) {
				CompilerElement previousEl = tableElements.get(pos);
				switch (previousEl.status) {
					case CORE:
						if (!docInfo.isOverride()) {
							throw new DuplicateNameException(
								"Cannot override core extension: " + previousEl.name);
						}
						status = Status.EXTENSION_OVERPENDING;
						break;
					case EXTENSION:
					case EXTENSION_ERROR:
					case EXTENSION_REMOVE:
					case EXTENSION_REPLACE:
						status = Status.EXTENSION_REPLACE;
						break;
					case EXTENSION_OVERRIDE:
					case EXTENSION_OVERPENDING:
						status = Status.EXTENSION_OVERPENDING;
						break;
					case EXTENSION_INSTALL:
						break;
				}
			}
			CompilerElement newEl =
				new CompilerElement(docInfo.getFormalName(), docInfo.getType(), status);
			newEl.xmlString = document;
			if (pos >= 0) {
				tableElements.set(pos, newEl);
			}
			else {
				tableElements.add(newEl);
			}
			tableElements.sort(null);
			changesMade(true);
			tableModel.fireTableDataChanged();
		}
		catch (Exception e) {
			errMessage = e;
		}
		if (errMessage != null) {
			Msg.showError(this, this, "Import Failure", errMessage.getMessage(), errMessage);
			return;
		}
	}
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