XPath for elements with attribute not equal or does not exist
<p>I have the following XML format:</p>

<pre><code>&lt;test&gt;
 &lt;table&gt;
   &lt;rows&gt;
     &lt;row ID = "1" Name ="A"/&gt;
     &lt;row ID = "2" SubID = "1" Name ="B"/&gt;
     &lt;row ID = "3" Name ="C"/&gt;
     &lt;row ID = "4" SubID = "1" Name ="D"/&gt;
     &lt;row ID = "5" Name ="E"/&gt;
     &lt;row ID = "4" SubID = "2" Name ="E"/&gt;
   &lt;/rows&gt;
   .
   .
 &lt;/table&gt;
&lt;/test&gt;
</code></pre>

<p>I would like to take all the rows except the ones that do have <code>SubID = 1</code>.</p>

<p><strong>The hard part of this, is that not all the rows have attribute called <code>SubID</code>, and that not all the rows with the attribute <code>SubID</code>, have same value</strong>.</p>

<p>The ideal output should be:</p>

<pre><code>&lt;row ID = "1" Name ="A"/&gt;
&lt;row ID = "3" Name ="C"/&gt;
&lt;row ID = "5" Name ="E"/&gt;
&lt;row ID = "4" SubID = "2" Name ="E"/&gt;
</code></pre>

<p>I have tried to use an XPath with negation on value, but this won't work:</p>

<pre><code>/test/table/row/not(@SubID=1)
</code></pre>

<p>Any help?</p>