必要に応じて、XML PATH を SELECT のサブクエリに入れることもできます。
私はこの構造を好みます:
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)