public Element saveToXml() {
		Element root = new Element("CONNECTION");
		root.setAttribute("PRODUCER", producerTool.getName());
		root.setAttribute("CONSUMER", consumerTool.getName());
		root.setAttribute("LISTENER_ADDED", "" + listenerAdded);
		String[] keys = connectHt.getKeys();
		for (String key : keys) {
			Element elem = new Element("EVENT");
			elem.setAttribute("NAME", key);
			int val = DISCONNECTED;
			try {
				val = connectHt.get(key);
			}
			catch (NoValueException nve) {
			}
			elem.setAttribute("CONNECTED", (val == CONNECTED ? "true" : "false"));
			root.addContent(elem);
		}
		changed = false;
		return root;
	}
Saves the Tool Connection into an XML element.
Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolConnectionImpl.java