title: Use ampersand in CAST in SQL
body: <p>The following code snippet on SQL server 2005 fails on the ampersand '&amp;':</p>
  
  <pre><code>select cast('&lt;name&gt;Spolsky &amp; Atwood&lt;/name&gt;' as xml)
  </code></pre>
  
  <p>Does anyone know a workaround?</p>
  
  <p>Longer explanation, I need to update some data in an XML column, and I'm using a search &amp; replace type hack by casting the XML value to a varchar, doing the replace and updating the XML column with this cast. </p>