If i wanted to add an attribute to the root element record, can i do this from the sql side?
SELECT top 1 \'text\' as nodeA from test as z FO
SELECT 'someValue' AS '@Attribute', (SELECT TOP 1 'text' as 'z/NodeA' FROM dbo.Test WHERE.... FOR XML PATH('YourElement') ) FOR XML PATH('ROOT');
It should create a xml with ROOT containg attribute and list of ... inside.