private void writeStructure(XmlWriter writer, Structure struct) {
		XmlAttributes attrs = new XmlAttributes();
		attrs.addAttribute("NAME", struct.getDisplayName());
		attrs.addAttribute("NAMESPACE", struct.getCategoryPath().getPath());
		attrs.addAttribute("SIZE", struct.isZeroLength() ? 0 : struct.getLength(), true);
		writer.startElement("STRUCTURE", attrs);
		writeRegularComment(writer, struct.getDescription());
		DataTypeComponent[] members = struct.getComponents();
		for (DataTypeComponent member : members) {
			writerMember(writer, member);
		}
		writer.endElement("STRUCTURE");
	}
Writes datatypes into XML using the specified XML writer.
@param writer the XML writer
@param monitor the task monitor
@throws CancelledException if the user cancels the write operation
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/DataTypesXmlMgr.java