title: xpath to select elements with last child value
body: <p>This is my xml file</p>
  
  <pre><code>&lt;profiles&gt;
   &lt;profile id='8404'&gt;
    &lt;name&gt;john&lt;/name&gt;
    &lt;name&gt;mark&lt;/name&gt;
   &lt;/profile&gt;
   &lt;profile id='8405'&gt;
    &lt;name&gt;john&lt;/name&gt;
   &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>and I want to select profiles where last "name" child value= john, the result should contains the profile with id=8405 only
  what it the xpath that can evaluate this?</p>
  
  <p>here is my trial:</p>
  
  <pre><code>     var filterdFile = profilefileXML.XPathSelectElements("/profiles/profile[name[last()]='john']");
  </code></pre>
  
  <p>but it doesn't make sense.</p>
  
  <p>Updated:
  My trail is correct, there was only a syntax error in it. Thanks all</p>