void write(XmlWriter writer, AddressSetView set, TaskMonitor monitor) throws CancelledException {

		writer.startElement("REGISTER_VALUES");

		List<Register> regs = getUniqueRegisters();
		if (set == null) {
			set = program.getMemory();
		}
		AddressRangeIterator rangeIter = set.getAddressRanges();
		while (rangeIter.hasNext()) {
			if (monitor.isCancelled()) {
				throw new CancelledException();	
			}

			AddressRange range = rangeIter.next();
		
			for (Register reg : regs) {
				AddressRangeIterator it = context.getRegisterValueAddressRanges(reg, range.getMinAddress(), range.getMaxAddress());
				while(it.hasNext()) {
					monitor.checkCancelled();
					AddressRange valueRange = it.next();
					BigInteger value = context.getValue(reg, valueRange.getMinAddress(),false);
					if (value == null) {
						continue;
					}
					XmlAttributes attr = new XmlAttributes();
					attr.addAttribute("REGISTER", reg.getName());
					attr.addAttribute("VALUE", value, true);
					attr.addAttribute("START_ADDRESS", XmlProgramUtilities.toString(valueRange.getMinAddress()));				
					attr.addAttribute("LENGTH", valueRange.getLength(), true);
					writer.writeElement("REGISTER_VALUE_RANGE", attr);
				}
			}
		}
		
		writer.endElement("REGISTER_VALUES");
	}
Write out the XML for the Equates.
@param writer writer for XML
@param set address set that is either the entire program or a selection
@param monitor monitor that can be canceled
should be written
@throws IOException
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/RegisterValuesXmlMgr.java