private void addToolTemplate(InputStream instream, String path) {
		try {
			SAXBuilder sax = XmlUtilities.createSecureSAXBuilder(false, false);
			Element root = sax.build(instream).getRootElement();

			ToolTemplate template = new GhidraToolTemplate(root, path);
			if (plugin.getActiveProject().getLocalToolChest().addToolTemplate(template)) {
				Msg.info(this,
					"Successfully added " + template.getName() + " to project tool chest.");
			}
			else {
				Msg.warn(this, "Could not add " + template.getName() + " to project tool chest.");
			}
		}
		catch (Exception e) {
			Msg.showError(getClass(), tool.getToolFrame(), "Error Reading Tool",
				"Could not read tool: " + e, e);
		}
	}
Create the Template object and add it to the tool chest.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/ToolActionManager.java