Not clear what your query is trying to do, look like it is incomplete. I'm guessing this is what you trying to do. Let us know if that not the case.
DECLARE @Table1 TABLE (ID INT,Value INT)
INSERT INTO @Table1
VALUES (1,100)
,(1,200)
,(1,300)
,(1,400)
,(2,300)
,(2,400)
SELECT DISTINCT ID
,STUFF((
SELECT ', ' + CAST(ST1.value AS VARCHAR(10)) AS [text()]
FROM @Table1 st1
WHERE st1.id = st2.ID
FOR XML PATH('')
), 1, 2, '') test
FROM @Table1 ST2
WHERE ST2.ID = 1
Output:
ID test
1 100, 200, 300, 400