title: SQL Server: Find records where XML is missing tag
body: <p>I have table named: XMLIndex that contains a column named: XMLRec that holds the structure of an XML file and values. </p>
  
  <p>Some of these records are missing a tag named: <code>&lt;ISO&gt;&lt;/ISO&gt;</code></p>
  
  <p>My question is: what type of query do I need to run in order to find all the records in the table XMLIndex, that are missing the <code>&lt;ISO&gt;</code> tag?</p>
  
  <p>This is an example XMLRecord XML that contains the ISO tag:</p>
  
  <pre><code>&lt;XMLRecord&gt;
    &lt;pn&gt;0042761&lt;/pn&gt;
    &lt;SRI&gt;4.40&lt;/SRI&gt;
    &lt;igm&gt;/images/images/0042761.gif&lt;/img&gt;
    &lt;ISO&gt;ZW&lt;/ISO&gt;
    &lt;ListPrice&gt;$5.50&lt;/ListPrice&gt;  
  &lt;/XMLRecord&gt;
  </code></pre>
  
  <p>and one with multiple ISOs (look at the tag small difference):</p>
  
  <pre><code>&lt;XMLRecord&gt;
    &lt;pn&gt;0042762&lt;/pn&gt;
    &lt;SRI&gt;4.40&lt;/SRI&gt;
    &lt;igm&gt;/images/images/0042762.gif&lt;/img&gt;
    &lt;ISOs&gt;ZW+NZ+AU+BR&lt;/ISOs&gt;
    &lt;ListPrice&gt;$5.50&lt;/ListPrice&gt;  
  &lt;/XMLRecord&gt;
  </code></pre>
  
  <p>One record missing the ISO tag is one that the XML structure would not contain such tag.</p>
  
  <p>Any examples are much appreciated. </p>
  
  <p>Thank you.</p>