SELECT Customer.CustomerID, Customer.FirstName, Customer.LastName, [Order].SalesOrderID, [Order].OrderDate, [Order].TotalDue, OrderItem.ProductID, (SELECT p.Name FROM Production.Product p WHERE p.ProductID = OrderItem.ProductID) ProductName, OrderItem.OrderQty, OrderItem.LineTotal FROM ( SELECT p.BusinessEntityID PersonID, c.CustomerID, p.FirstName, p.LastName FROM Person.Person p LEFT JOIN Sales.Customer c ON p.BusinessEntityID = c.PersonID ) AS Customer INNER JOIN Sales.SalesOrderHeader [Order] ON Customer.CustomerID = [Order].CustomerID INNER JOIN Sales.SalesOrderDetail [OrderItem] ON [Order].SalesOrderID = [OrderItem].SalesOrderID FOR XML AUTO, ROOT('Customers')