O'Reilly logo
  • Dustin Waybright thinks this is interesting:

SELECT [Customer].custid AS [custid],
 [Customer].companyname AS [companyname],
 [Order].orderid AS [orderid],
 [Order].orderdate AS [orderdate]
FROM Sales.Customers AS [Customer]
 INNER JOIN Sales.Orders AS [Order]
  ON [Customer].custid = [Order].custid
WHERE 1 = 2
FOR XML AUTO, ELEMENTS,
    XMLSCHEMA('TK461-CustomersOrders');

From

Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012

Note

Adding XMLSCHEMA to the file in the XML clause