title: In XPath I want a expression to select all under div but those nodes that are not a. The tree structure must remain the same
body: <p>How to exclude specific descendants of a node? In this direction, the expression *[not(self::nodetag)] seems just to discriminate at a child level of the node, accepting all other descedants in the returned node set. I want a expression to select all under div but those nodes that are not a, see example below. The tree structure must remain the same.</p>
  
  <p>The approach poste by @Dimitri Novatchev seems to be right but not for HAP implementation:</p>
  
  <p>Using this example document:</p>
  
  <pre><code>&lt;div&gt;
    &lt;span&gt;
       &lt;a&gt;lala&lt;/a&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The HAP would return the following structure with his suggested expression /div/descendant::node()[not(self::a)]</p>
  
  <pre><code>&lt;div&gt;
    &lt;span&gt;
       &lt;a&gt;lala&lt;/a&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;span&gt;
       &lt;a&gt;lala&lt;/a&gt;
   &lt;/span&gt;
  </code></pre>
  
  <p>If there would be another tag other than a nested on span, it would also return it as a separte tree, any one know about this strange behavior? Is it a HAP bug?</p>
  
  <p>Thanks</p>