 <p>you're probably looking for "FOR XML" T-SQL clause</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms178107.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms178107.aspx</a></p> <blockquote> <p>A SELECT query returns results as a rowset. You can optionally retrieve formal results of a SQL query as XML by specifying the FOR XML clause in the query. The FOR XML clause can be used in top-level queries and in sub queries. The top-level FOR XML clause can be used only in the SELECT statement. In sub queries, FOR XML can be used in the INSERT, UPDATE, and DELETE statements. It can also be used in assignment statements.</p> </blockquote> <p>take a look on this site too</p> <p><a href="http://blogs.msdn.com/b/saurabh_singh/archive/2010/05/11/export-sql-table-records-to-xml-form.aspx" rel="nofollow">http://blogs.msdn.com/b/saurabh_singh/archive/2010/05/11/export-sql-table-records-to-xml-form.aspx</a></p>