public static boolean writeToolTemplate(ToolTemplate template) {

		USER_TOOLS_DIR.mkdirs();
		String toolName = template.getName();
		File toolFile = getToolFile(toolName);

		boolean status = false;
		try (OutputStream os = new FileOutputStream(toolFile)) {

			Element element = template.saveToXml();
			Document doc = new Document(element);
			XMLOutputter xmlout = new GenericXMLOutputter();
			xmlout.output(doc, os);
			os.close();

			status = true;

		}
		catch (Exception e) {
			Msg.error(LOGGER, "Error saving tool: " + toolName, e);
		}
		return status;
	}
Returns all tools found in the classpath that live under a root
'defaultTools' directory or a root 'extraTools' directory

@return the tools
Ghidra/Framework/Project/src/main/java/ghidra/framework/ToolUtils.java