declare @t table(id int, tags varchar(50))
insert into @t values
(1, 'Html'),
(2, 'Head'),
(3, 'Title'),
(4, 'Meta'),
(5, 'Body'),
(6, 'Font')
;with Tags1 as
(
select xml1 = (select '<' + tags + '>' from @t for xml path (''))
)
,Tags2 as
(
select xml2 = (select '</' + tags + '>' from @t order by id desc for xml path (''))
)
select replace(replace(Tags1.xml1 + Tags2.xml2,'<','<'),'>','>')
from Tags1, Tags2