How to Retrieve Data from SQL Server Database in XML Format?

After the release of the SQL Server 2000 the way the data is retrieved has taken a new dimension. The support for XML format is there from the version of SQL Server 2000.

With that it is possible to retrieve data from the SQL Server database in the XML format. SQLXML is used for this purpose. With such possibilities it is possible to access data in the SQL Server using URL based queries where the queries are transported using HTTP.

If you are already familiar with the SQL queries then it is very easy to create queries that return data in XML format. The syntax for such SQL queries would be,

SELECT ... FOR XML mode

The values of the