Consider the following template:
<?
xml version="1.0" encoding="utf-8" ?><
Order xmlns:sql="urn:schemas-microsoft-com:xml-sql"><sql:header><sql:param name="customerId"></sql:param></sql:header><CustomerInfo statusCode="active"><sql:query>SELECT * FROM customers
WHERE customerId=@customerId
FOR XML AUTO, elements
</sql:query></CustomerInfo><Orders><sql:query>SELECT * FROM Orders
INNER JOIN [Order Details] OrderDetail
ON Orders.OrderId = OrderDetail.OrderId
WHERE customerId=@customerId
FOR XML AUTO
</sql:query></Orders></
Order>When properly configured for the Northwind database, the url
http://localhost/NorthWind/template/message.xml?customerId=ALFKI
delivers a nicely nested xml result.
EE de Bel