private void processExtLibraryReference(XmlElement element, boolean overwrite) {
		try {
			String addrStr = element.getAttribute("ADDRESS");
			if (addrStr == null) {
				throw new XmlAttributeException(
					"ADDRESS attribute missing for EXT_LIBRARY_REFERENCE element");
			}
			Address addr = XmlProgramUtilities.parseAddress(factory, addrStr);
			if (addr == null) {
				throw new AddressFormatException(
					"Incompatible External Reference Address: " + addrStr);
			}
			int opIndex = CodeUnit.MNEMONIC;
			if (element.hasAttribute("OPERAND_INDEX")) {
				opIndex = XmlUtilities.parseInt(element.getAttribute("OPERAND_INDEX"));
			}
			boolean userDefined = true;
			if (element.hasAttribute("USER_DEFINED")) {
				userDefined = XmlUtilities.parseBoolean(element.getAttribute("USER_DEFINED"));
			}
// FIXME Do we need to introduce more/different external tags now? (namespaces, classes, etc.)
			String programName = element.getAttribute("LIB_PROG_NAME");
			String label = element.getAttribute("LIB_LABEL");
			Address libAddr = element.hasAttribute("LIB_ADDR")
					? factory.getAddress(element.getAttribute("LIB_ADDR"))
					: null;

			if (label == null && libAddr == null) {
				log.appendMsg("External library reference for address " + addr +
					" does not have a label or an external address specified at " +
					element.getLineNumber() + ". External reference will not be created");
				return;
			}
			CodeUnit cu = listing.getCodeUnitAt(addr);
			if (cu == null) {
				log.appendMsg("No codeunit at " + addr);
				return;
			}
			Reference ref = cu.getExternalReference(opIndex);
			if (ref != null) {
				if (!overwrite) {
					return;
				}
				program.getReferenceManager().delete(ref);
			}

// FIXME What do we need to do for externals in XML now?
// FIXME
			SetExternalRefCmd addCmd = new SetExternalRefCmd(addr, opIndex, programName, label,
				libAddr, userDefined ? SourceType.USER_DEFINED : SourceType.IMPORTED);
			addCmd.applyTo(program);

//			// if there happens to be a pointer here, then
//			// delete the memory references associated to it...
//			//
//			Data data = listing.getDataAt(addr);
//			if (data != null && data.isPointer()) {
//				Address toAddr = (Address) data.getValue();
//				if (toAddr != null) {
//					Reference mr = refManager.getReference(addr, toAddr, opIndex);
//					if (mr != null) {
//						RemoveReferenceCmd removeCmd = new RemoveReferenceCmd(mr);
//						removeCmd.applyTo(program);
//					}
//				}
//			}

		}
		catch (Exception e) {
			log.appendException(e);
		}
	}
@param element
@param language
@param overwrite
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/MarkupXmlMgr.java