void write(XmlWriter writer, AddressSetView addrs, TaskMonitor m)
			throws CancelledException {
		this.monitor = m;
		m.setMessage("Writing PROGRAM TREES ...");

		writer.startElement("PROGRAM_TREES");
		String[] treeNames = listing.getTreeNames();

		for (String treeName2 : treeNames) {
			if (m.isCancelled()) {
				throw new CancelledException();
			}
			XmlAttributes attrs = new XmlAttributes();
			attrs.addAttribute("NAME", treeName2);
			writer.startElement("TREE", attrs);

			ProgramModule root = listing.getRootModule(treeName2);

			ArrayList<ProgramModule> writtenModules = new ArrayList<>();
			ArrayList<ProgramFragment> writtenFragments = new ArrayList<>();

			writeModule(writer, addrs, root, writtenModules, writtenFragments);

			writer.endElement("TREE");
		}
		writer.endElement("PROGRAM_TREES");
	}
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