Other way around works too (I gave an example above), it's just not pretty in either direction.
XML makes sense for open-ended, human-written things like documents or apps. It doesn't work so well for APIs and other machine-read/written things where you'd normally use JSON.
Like that time there were hundreds of forms to build, refused, held a silent protest until a reasonable way presented itself.
Enter "XML Form Template" or "XML Form Definition.", A form is generated from the XML in html, filled in, and on submit, the XML is filled back in.
Built one form renderer and done. Never got old watching it.
XForms (W3C standard)
https://www.w3.org/TR/2003/REC-xforms-20031014/slice2.html