STUFF vs COALESCE in TSQL for Concatenating row values

Say you have a result set that looks like the following table:

STUFF vs COALESCE in TSQL for Concatenating row values

Say you have a result set that looks like the following table:

Now what you want is, to have the result set to look like below:

In the old days of SQL Server 7.0 and SQL Server 2000, I Used to do this with a variable and using COALESCE like the following:

But after SQL Server 2005 and XPATH appearance, I prefer to use STUFF and XPATH as below:

Cheers…