If you want declarative templating, then LitTemplate is an option. There’s a little bit of JavaScript wrapped around it but the actual template is based on HTML.
The big problem with any such template is that connecting it with logic in Java leads to using magic strings that must match between both sides. There are also trade-offs with things like auto completion for using component-specific features. These limitations can be addressed with IDE plugins but that’s a significant effort.
That’s why we use regular Java code as the source of truth for Copilot. It can edit anything that it produces itself and all Java code written in a similar style. Anything more complicated might not be editable but that’s on the other hand also the kind of structure that you anyways couldn’t express in an XML-like template so that doesn’t really change anything.