/* In the previous example, we had assigned an alias to the table in order to customize the element names of each row. This approach works well. However, if the query is complex, some times, it will be very confusing to use alias names just to format the XML node names. The AUTO keyword does not provide a way to customize the name of rows. By using the RAW keyword, instead of AUTO, we can easily customize the rows. The following example demonstrates this by using the RAW keyword. */ SELECT OrderNumber, ItemNumber, Qty FROM OrderDetails FOR XML RAW('itemInfo'), TYPE, ELEMENTS, ROOT('orderInfo') /* OUTPUT: 00001 A001 10 00001 A002 20 00001 A003 30 */