void restoreFromXml(Element xml) {

		Set<ExtensionDetails> installedExtensions = getExtensions();
		if (installedExtensions.isEmpty()) {
			return;
		}

		Set<String> knownExtensionNames = getKnownExtensions(xml);
		Set<ExtensionDetails> newExtensions = new HashSet<>(installedExtensions);
		for (ExtensionDetails ext : installedExtensions) {
			if (knownExtensionNames.contains(ext.getName())) {
				newExtensions.remove(ext);
			}
		}

		// Get a list of all plugins contained in those extensions. If there are none, then either 
		// none of the extensions has any plugins, or Ghidra hasn't been restarted since installing 
		// the extension(s), so none of the plugin classes have been loaded. In either case, there 
		// is nothing more to do.
		Set<Class<?>> newPlugins = findLoadedPlugins(newExtensions);
		newExtensionPlugins.addAll(newPlugins);
	}
A class to manage saving and restoring of known extension used by this tool.
Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ExtensionManager.java