title: Proper encoding for Sql XML from C# string
body: <p>So I ran into this error this morning saving a <code>String</code> to Sql Server 2008 R2 to an <code>XML</code> data type which represents an entire <code>XML</code> document being sent across a Web Service.  The save failed on a special character which threw an "illegal xml character" error from Sql.  The special character is a bullet point -- •.  </p>
  
  <p>I believe that I need to just try to Encode whatever input may come from a user when building the <code>XML</code> in the Web Service which I do through creating an <code>XElement</code> array consuming each of the properties on the object that I want to send across the Web Service.  My initial thought was to use the System.Web.HttpUtility.HtmlEncode() method to encode any and all user input to proper HTML thinking that would make Sql happy but it has not; the same error still appears.</p>
  
  <p>I know that Sql Server's XML data type is UTF-16 but I don't have my head wrapped well enough around all this encoding stuff to be able to find a solution yet.  Can anybody offer any assistance or point me in the right direction?  </p>