MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value:
SELECT col1 FROM table1 WHERE col2 = \'x\' ORDER by col
For EXPLICIT xml generation - with unions you need to wrap results one more time (As a bonus result as XML):
SELECT CAST( ( SELECT * FROM ( SELECT 1 AS Tag ,NULL AS Parent ... UNION ALL SELECT ... FOR XML EXPLICIT ) ) as XML) as [MyName]