Also, would all this hackiness go away if htmlmixed referenced the xml mode via a MIME string (`"text/html"`) instead of a one-off configuration bag (`{name: "xml", htmlMode: true}`)?  Maybe we should just submit that as a patch to CodeMirror.