By appending FOR XML auto to the end of your sql statement you can have your sql recordset returned as XML. A very useful utility.
SELECT * FROM [Table Name] FOR XML auto
Depending whether you pull from one or multiple tables, your output is structured XML based on the database schema. In situations we you are joining two tables there are two ways to have data returned in a clean way, (1) User a View or (2) User sub-queries.