Actually the reason is a very good one: most people design UIs graphically (Qt Designer, XCode Interface Builder, etc.), and UIs naturally lend themselves to the structure found in XML.
The tree structure is what matters, not XML. Qt itself moved to QML for new UIs: a dedicated language that’s nicer to write