title: XPATH select only first level children
body: <p>I have the fowoling xml : </p>
  
  <pre><code>  &lt;workflow URI=""&gt; 
    &lt;output ID="" URI="#out1"/&gt;  
    &lt;input ID="sessionToken" URI="#sessionToken"/&gt;  
    &lt;services&gt; 
      &lt;sequence&gt; 
        &lt;service URI=""&gt; 
          &lt;input ID="" URI=""/&gt;  
          &lt;input URI="" value=""/&gt;  
          &lt;output ID="" URI=""/&gt; 
        &lt;/service&gt; 
      &lt;/sequence&gt; 
    &lt;/services&gt; 
  &lt;/workflow&gt;
  </code></pre>
  
  <p>I want to select only the first level children of the workflow node and exclude from this selection the services node, so in my case I would only want </p>
  
  <pre><code> &lt;output ID="" URI="#out1"/&gt;  
   &lt;input ID="sessionToken" URI="#sessionToken"/&gt;  
  </code></pre>
  
  <p>this two nodes selected, and I want to use XPATH in java for this. The additional requirments is that the selected node must have the URI parameter.</p>
  
  <p>I have tried this :</p>
  
  <pre><code>XPathExpression expr = xpath.compile("//workflow[@URI='" + oldUrlValue.getNodeValue() + "'] | //workflow//*[not(local-name() = 'services') and @URI]");
  </code></pre>
  
  <p>but I get backall the nodes with URI parameters instead only the main workflow node and the first two children.</p>
  
  <p>I have tried this</p>