• Nice Article. The last two workarounds can be achieved by a statement as follows. No need of workarounds

    SELECT

    Country.CountryName AS [name],

    Country.Currency,

    City.CityName AS [name],

    Customer.CustomerNumber AS [id],

    Customer.CustomerName AS [name],

    Customer.Phone

    FROM

    Customers Customer

    INNER JOIN Cities City ON (City.CityID = Customer.CityID)

    INNER JOIN Countries Country ON (Country.CountryID = City.CountryID)

    ORDER BY CountryName, CityName

    FOR XML AUTO, root('CustomersByRegion')

    Root function gives a way to assign a name for the root element.