void read(XmlPullParser parser, boolean overwrite, boolean isExtLibs, boolean isFunctions,
			boolean ignoreStackReferences, TaskMonitor monitor)
			throws SAXParseException, CancelledException {
		XmlElement element = parser.next();
		if (!element.isStart() || !element.getName().equals("MARKUP")) {
			throw new SAXParseException("Expected MARKUP start tag", null, null,
				parser.getLineNumber(), parser.getColumnNumber());
		}

		element = parser.next();
		while (element.isStart()) {
			if (monitor.isCancelled()) {
				throw new CancelledException();
			}
			String tagName = element.getName().toUpperCase();
			if (tagName.equals("MEMORY_REFERENCE")) {
				processMemoryReference(element, overwrite);
			}
			else if (tagName.equals("STACK_REFERENCE")) {
				if (isFunctions && !ignoreStackReferences) {
					processStackReference(element, overwrite);
				}
			}
			else if (tagName.equals("EXT_LIBRARY_REFERENCE")) {
				if (isExtLibs) {
					processExtLibraryReference(element, overwrite);
				}
			}
			else if (tagName.equals("EQUATE_REFERENCE")) {
				processEquateReference(element, overwrite);
			}
			else if (tagName.equals("MANUAL_OPERAND")) {
				// Not yet supported
			}
			else if (tagName.equals("MANUAL_INSTRUCTION")) {
				// Not yet supported
			}
			else {
				throw new SAXParseException("Unexpected XML tag: " + tagName, null, null,
					parser.getLineNumber(), parser.getColumnNumber());
			}

			// read end of tag
			element = parser.next();
			if (element.isStart() || !element.getName().equalsIgnoreCase(tagName)) {
				throw new SAXParseException("Expected " + tagName + " end tag", null, null,
					parser.getLineNumber(), parser.getColumnNumber());
			}

			// read next tag
			element = parser.next();
		}

		if (!element.getName().equals("MARKUP")) {
			throw new SAXParseException("Expected MARKUP end tag", null, null,
				parser.getLineNumber(), parser.getColumnNumber());
		}
	}
XML manager for all references ("markup" for operand substitution).
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/MarkupXmlMgr.java