Puoi anche inserire XML PATH in una sottoquery in SELECT, se lo desideri.
Preferisco solo questo costrutto:
SELECT
b.date,
SUBSTRING(CAST(foo.bar AS varchar(8000)), 2, 7999) AS orderList
FROM
bank b
JOIN
movemoney m ON b.code = m.code
OUTER APPLY
(
SELECT
',' + concatenatedid
FROM
order o
WHERE
o.number = m.number
FOR XML PATH ('')
) foo(bar)