Need a help.

I have a table with two Coloumns, Coloumn A and Coloumn B. Please See the structure below:

Coloumn A Coloumn B
1 X
1 Y
1 Z
2 P
2 Q
2 R
2 S

And the result I am looking Should be in the below structure:

Coloumn A ColoumnB

This means values corresponding to 1 should get concatenated and be present in a single form, same for 2 as well.
We will be extracting the result into one table.
We want to obtain this result using below funtions:

1. recursive SQL
2. XML

Thanks in advance.