Take a look at my PMS ingergration, I have a script which generates json string itemised by orders grouped by tickets for passing sales data to our PMS. It wouldn’t be hard to generate xml instead.
If I went back and did it again I’d build an array and json stringify instead of handling strings but was less experianced when initially made.
Pretty sure there is a xml equivalent to stringify.
Also I took data direct from SQL but now with gql it would probably be better to use that to call info.
It’s a long topic, kendashs and q helped me allot as before this had never used jscript/Java and only ever have minimal SQL experience.
With the addition of graphql there are likely improvements removing the need to the SQL queries and improvements but been almost 2 years since we went live with it and other than the odd update for PMS API changes or minor tweaks to account for unforseen events.