⟩ What is FOR XML in SQL Server?
FOR XML allows data to be retrieved in an XML format. The FOR XML clause needs to be mentioned at the end of SELECT statement. There are three modes of FOR XML:-
RAW mode: - An XML element is formed for each row in the query results.
AUTO mode: - The query results are returned as nested XML elements.
Explicit mode: - the format of the XML document returned by the query can be completely controlled by the query.