title: Insert int variable into xml type
body: <p>What a want to do is something like that:</p>
  
  <pre><code>declare @id int
  set @id = (select ID from tbUsers where Name = 'John_Stack')
  
  declare @xml xml
  set @xml = '&lt;users&gt; &lt;user id = "' + @id + '"/&gt;&lt;/users&gt;'
  </code></pre>
  
  <p>The server aborted saying </p>
  
  <blockquote>
    <p>Operand type clash: int is incompatible with xml.</p>
  </blockquote>
  
  <p>What is the best way to do this?</p>
  
  <p>I'm working with SQL Server 2005.</p>
  
  <p>Thanks in advance.</p>