title: Sql select query set html tags using for xml path
body: <p>I am having two queries which retuns data containing html tag. Sql Query 1 works fine but Sql Query 2 not returns exact html tag,
  query 2 data is nested html tag.</p>
  
  <p><strong>Query 1 :</strong></p>
  
  <pre><code>declare @val1 nvarchar(max)
  declare @val2 nvarchar(max)
  set @val1='my value one';
  set @val2='my value two';
  select data=( select @val1 as td, '' ,@val2 as td for xml path('tr'))
  </code></pre>
  
  <p><strong>OutPut:</strong></p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;my value one&lt;/td&gt;&lt;td&gt;my value two&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Query 2 :</strong></p>
  
  <pre><code> select stuff(( select ','+'&lt;span&gt;'+@val1+'&lt;span&gt;'+@val2+'&lt;/span&gt;&lt;/span&gt;'       
                    for xml path('')),1,1,'') as Col1
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>&amp;lt;span&amp;gt;my value one&amp;lt;span&amp;gt;my value two&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;
  </code></pre>
  
  <p><strong>Desired Output:</strong></p>
  
  <pre><code>&lt;span&gt;my value one&lt;span&gt;my value two&lt;/span&gt;&lt;/span&gt;
  </code></pre>