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
DECLARE @XmlData XML; SET @XmlData =(SELECT * FROM [dbo].[Users] ORDER by UserName FOR XML path('')) SELECT @XmlData AS Result