private void processFragment(XmlElement element, XmlPullParser parser) {

		String name = element.getAttribute("NAME");

		if (!fragmentNameList.contains(name)) {
			fragmentNameList.add(name);
		}
		ProgramModule parent = moduleStack.peek();
		ProgramFragment frag = null;
		try {
			frag = parent.createFragment(name);
		}
		catch (DuplicateNameException dne) {
			frag = listing.getFragment(treeName, name);
			try {
				parent.add(frag);
			}
			catch (DuplicateGroupException dge) {
				// ignore, we are trying to add a fragment to
				// a module that already contains it
			}
		}
		try {
			processFragmentRange(frag, parser);
		}
		catch (NotFoundException e) {
			log.appendMsg(e.getMessage());
			parser.discardSubTree(element);
		}
		catch (Exception e) {
			log.appendException(e);
			parser.discardSubTree(element);
		}
	}
Write out the XML for the program trees.
@param writer writer for XML
@param addrs the addresses
@param m monitor that can be canceled should be written
@throws CancelledException if cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/util/xml/ProgramTreeXmlMgr.java