does this example, where I'm applying some styles to the results help?
note i have to do a find/replace to the string to unescape some characters;
DECLARE @HTMLBody varchar(max)
Select @HTMLBody = (Select Row_Number() Over(Order By is_linked, name) % 2 As [TRRow],
name As
,
product As
,
provider As
,
data_source As
,
is_linked As
From sys.servers
Order By is_linked, name
For XML raw('tr'), Elements)
Set @HTMLBody = Replace(@HTMLBody, '_x0020_', space(1))
Set @HTMLBody= Replace(@HTMLBody,'_x0022_','"')
Set @HTMLBody= Replace(@HTMLBody,'_x003B_',';')
Set @HTMLBody = Replace(@HTMLBody, '_x003D_', '=')
Set @HTMLBody = Replace(@HTMLBody, '<tr><TRRow>1</TRRow>', '<tr bgcolor="#C6CFFF">')
Set @HTMLBody = Replace(@HTMLBody, '<TRRow>0</TRRow>', '')
Select '<table>' + @HTMLBody + '</table>'
Lowell