@Override
	public void saveXml(Writer fwrite) throws IOException {
		fwrite.append('<').append(name).append(">\n");
		fwrite.append("<tablename>");
		SpecXmlUtils.xmlEscapeWriter(fwrite, tableName);
		fwrite.append("</tablename>\n");
		fwrite.append("<keytype>");
		fwrite.append(Integer.toString(keyType));
		fwrite.append("</keytype>\n");
		fwrite.append("<valuetype>");
		fwrite.append(Integer.toString(valueType));
		fwrite.append("</valuetype>\n");
		if (attemptCreation) {
			fwrite.append("<create>true</create>\n");
		}
		else {
			fwrite.append("<create>false</create>\n");
		}
		if (clearTable) {
			fwrite.append("<clear>true</clear>\n");
		}
		else {
			fwrite.append("<clear>false</clear>\n");
		}
		fwrite.append("</").append(name).append(">\n");
	}
Query whether an optional table exists. If it doesn't exist it can be created.
If it exists, it can be cleared
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/protocol/QueryOptionalExist.java