Actually this was one of the goals of XHTML, but then the HTML 5 movement killed it.
Had it worked out we could have gotten something like XAML, instead of the current Frankenstein model filled with workarounds and still failing short of a native experience.
People are working on it. Have a look at flutter.io or Qt and QML