I now have a basic XSLT transform working, which does the hard stuff -- it creates tagging which can be used to render in a human-readable way multiple coloured underlines for nested codes. I still have to do the control panel and work on the CSS, but the hard bit is done.