I wonder if OpenAI Structured Output [1] could be leveraged to constrain generation to required JSON Schema (and then convert to XML later)...
[1] https://platform.openai.com/docs/guides/structured-outputs