here's a really article example of creating an XML file...
https://www.simple-talk.com/sql/learn-sql-server/using-the-for-xml-clause-to-return-query-results-as-xml/
Here's a really simple query on a table I had handy...
SELECT CompanyID
, RTRIM(CompanyName) AS CompanyName
, RTRIM(Address) AS StreetAddress
, RTRIM(City) AS City
, RTRIM(State) AS [State]
, ZipCode
FROM Company
FOR XML RAW ('Company'), ROOT('Companies');
Hopefully that will get you started.