The "hard part" is actually easy: A basic
element[not(@
attribute= '
value')]
predicate will exclude elements without the attribute and elements for which attribute equals value.
So, in your specific case, all row
elements that do not have @SubID
equal to 1
:
/test/table/rows/row[not(@SubID = '1')]
selects
<row ID="1" Name="A"/>
<row ID="3" Name="C"/>
<row ID="5" Name="E"/>
<row ID="4" Name="E" SubID="2"/>
as requested.