Please refer the following links to convert the sql server table data as xml.
http://msdn.microsoft.com/en-us/library/ke345d80(v=VS.71).aspx
http://stackoverflow.com/questions/4625229/sql-server-t-sql-get-data-into-xml-using-for-xml-path
Eg: Select ID,Field1,Field2 from Test_TABLE
FOR XML PATH(''),ROOT('root')
http://msdn.microsoft.com/en-us/library/ke345d80(v=VS.71).aspx
http://stackoverflow.com/questions/4625229/sql-server-t-sql-get-data-into-xml-using-for-xml-path
Eg: Select ID,Field1,Field2 from Test_TABLE
FOR XML PATH(''),ROOT('root')