check out these tutorials: TSQL – Concatenate Rows using FOR XML PATH() | Sql And Me
sql server - SQL Query - Concatenating Results into One String - Stack Overflow
build the string as a nice piece of HTML in the query and get the result formatted how you like.