title: XQuery in Linq To Entities for Sql Server XML Data Type
body: <p>I am trying to figure out how to do a Linq To Entities query on a SQL Server Database which contains an XML datatype:</p>
  
  <p>I want to do a database level query that returns only a specified XML node that contains over 2000 Characters  </p>
  
  <p>Is this possible in Linq To Entities?</p>
  
  <p><strong>Update</strong></p>
  
  <p>well i want to do something like this in linq-to-entities but I don't think its possible</p>
  
  <pre><code>var q = from c in Changes
   where c.Content.XPathSelectElement("OpsNotes").Value.Length &gt;= 2000;
   select c;
  </code></pre>
  
  <p>inside the sql server database the XML content is a node called "OpsNotes" </p>
  
  <pre><code> &lt;Content Type="AP" Version="1"&gt;
    &lt;Name&gt;CPU FAIL-OVER&lt;/Name&gt;
    &lt;Bands&gt;
      &lt;Band&gt;BAND DATA&lt;/Band&gt;
    &lt;/Bands&gt;
    &lt;StartTime IsCritical="false" IsTimeSet="true"&gt;2009-12-06T14:00:00.0000000Z&lt;/StartTime&gt;
    &lt;Duration&gt;00:30:00&lt;/Duration&gt;
    &lt;RecurrenceRule&gt;RRULE:[List]{340/2009}&lt;/RecurrenceRule&gt;
    &lt;OpsNotes&gt;Rationale: Support standard weekly DVIS CPU fail-over&lt;/OpsNotes&gt;
     &lt;/Content&gt;
  </code></pre>