public Element saveToXml() {

		Element root = new Element("WORKSPACE");
		root.setAttribute("NAME", name);
		root.setAttribute("ACTIVE", "" + isActive);

		for (PluginTool tool : runningTools) {
			Element elem = new Element("RUNNING_TOOL");
			elem.setAttribute("TOOL_NAME", tool.getToolName());
			elem.addContent(tool.saveWindowingDataToXml());
			elem.addContent(tool.saveDataStateToXml(true));

			root.addContent(elem);
		}
		return root;
	}
saves the object to an XML element

@return an XML element containing the saved state
Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/WorkspaceImpl.java