/* So far, we have seen, how to rename the element as well as the columns. Now let us see how to rename the names of rows. By default the AUTO keyword generates rows with the name of the table/alias. */ SELECT OrderNumber, ItemNumber, Qty FROM OrderDetails itemInfo FOR XML AUTO, TYPE, ELEMENTS, ROOT('orderInfo') /* OUTPUT: 00001 A001 10 00001 A002 20 00001 A003 30 */