private void writeExternalReference(ExternalReference ref, XmlWriter writer) {

		XmlAttributes attr = new XmlAttributes();
		addCommonRefAttributes(attr, ref);
		ExternalLocation extLoc = ref.getExternalLocation();
		attr.addAttribute("LIB_PROG_NAME", extLoc.getLibraryName());
		String label = extLoc.getLabel();
		Address addr = extLoc.getAddress();
		if (label != null) {
			attr.addAttribute("LIB_LABEL", label);
		}
		if (addr != null) {
			attr.addAttribute("LIB_ADDR", XmlProgramUtilities.toString(addr));
		}
		writer.writeElement("EXT_LIBRARY_REFERENCE", attr);
	}
@param element
@param language
@param overwrite
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/MarkupXmlMgr.java