• The approach presented works well for a single client. I'm not sure how it would work in the current format if multiple clients needed to be shown. Something like this would work well for multiple clients.

    select *,

    (

    select *

    from dbo.sales s

    where s.clientid = c.clientid

    for xml path ('Sale'), type

    ) as Sales,

    (

    select *

    from dbo.vendor

    for xml path ('Vendor'), type

    )

    from dbo.clients c

    for xml path ('Clients'), root ('ClientOrders')