One things that will probably work (not sure if it's the best solution) would indeed be to set a delegate on the QTreeView. No need to subclass it.
Then override the delegates paint method.

create a QTextDocument, a QSyntaxHighlighter for it and set the (fragment for the QModelIndex of the) XML as plain text (in the QTextDocument).

Will probably work. (I did something like that once.)
Perhaps not efficient, though... best give it a try (and tell us about it!)

HTH