private TreeItem doCreateItem(String tagName, @SuppressWarnings("rawtypes") Hashtable atts,
				HelpSet hs, Locale locale) {
			TreeItem item = super.createItem(tagName, atts, hs, locale);

			CustomTreeItemDecorator newItem = new CustomTreeItemDecorator((TOCItem) item);

			if (atts != null) {
				String displayText = (String) atts.get("display");
				newItem.setDisplayText(displayText);
				String tocID = (String) atts.get("toc_id");
				newItem.setTocID(tocID);
			}
			return newItem;
		}
Our custom factory that knows how to look for extra XML attributes and how to 
create our custom tree items
Ghidra/Framework/Help/src/main/java/help/CustomTOCView.java