I think that things like React, and React-Native show the opposite is true... composition of UI elements that are meant to be rendered in relative terms doesn't tend to work out well when you are trying to use absolute measurements in something like C++ with lower-level constructs.
The fact that it is XML is more convention in this case... even with React, it's translated to coded controls via strict rules.. and is relatively easy to manage and reason with.