title: Xpath: select node based in a condition (with local-name())
body: <p>The question is quite silly, but I am completely stuck. I want to extract child nodes of a node based on a condition. The XML is as follows:</p>
  
  <pre><code>&lt;a&gt; 
   &lt;aCode&gt;aaa&lt;/aCode&gt;
   &lt;aValue&gt;bbb&lt;/aValue&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>The expression is obvious: <code>//a[aCode='aaa']</code></p>
  
  <p>But I can't get how I should change it if it is with namespaces and I've got to use <code>local-name()</code>. I've tested the following  and it gives a parsing error:</p>
  
  <pre><code>/*[local-name()='a'][[local-name()='aCode']='aaa']
  </code></pre>
  
  <p>Has anyone any idea of what I should do?</p>