title: LINQ to XML Example that Excludes Elements where Descendants Contains Value
body: <p>I'm new to LINQ to XML and was wondering if anyone could help me construct the following query.</p>
  
  <p>I want to return all the <code>&lt;response&gt;</code> elements that do not contain a descendant <code>&lt;status&gt;</code> element that contains "404".</p>
  
  <p>My XML is shown below. In this case, only the first <code>&lt;response&gt;</code> element (and descendants) should be returned.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;multistatus xmlns="DAV:"&gt;
    &lt;response&gt;
      &lt;href&gt;/principals/users/test/&lt;/href&gt;
      &lt;propstat&gt;
        &lt;prop&gt;
          &lt;calendar-home-set xmlns="urn:ietf:params:xml:ns:caldav"&gt;
            &lt;href xmlns="DAV:"&gt;/calendars/__uids__/d817aaec-7d24-5b38-bc2f-6369da72cdd9&lt;/href&gt;
          &lt;/calendar-home-set&gt;
        &lt;/prop&gt;
        &lt;status&gt;HTTP/1.1 200 OK&lt;/status&gt;
      &lt;/propstat&gt;
    &lt;/response&gt;
    &lt;response&gt;
      &lt;href&gt;/principals/users/test/calendar-proxy-write/&lt;/href&gt;
      &lt;propstat&gt;
        &lt;prop&gt;
          &lt;calendar-home-set xmlns="urn:ietf:params:xml:ns:caldav" /&gt;
        &lt;/prop&gt;
        &lt;status&gt;HTTP/1.1 404 Not Found&lt;/status&gt;
      &lt;/propstat&gt;
    &lt;/response&gt;
    &lt;response&gt;
      &lt;href&gt;/principals/users/test/calendar-proxy-read/&lt;/href&gt;
      &lt;propstat&gt;
        &lt;prop&gt;
          &lt;calendar-home-set xmlns="urn:ietf:params:xml:ns:caldav" /&gt;
        &lt;/prop&gt;
        &lt;status&gt;HTTP/1.1 404 Not Found&lt;/status&gt;
      &lt;/propstat&gt;
    &lt;/response&gt;
  &lt;/multistatus&gt;
  </code></pre>