title: XPath query how to get value of one attribute based on two attribute
body: <p>I want to extract name attribute value from the following tag</p>
  
  <pre><code>&lt;application
      comments="Do not erase this one"
      executable="run_CIET"
      icon="default"
      instances="1"
      mode="1"
      name="CIET"
      order="10"
      selection="1"
      tool="y"
  /&gt;
  </code></pre>
  
  <p>I can easily get value of name attribute value based on mode value as shown below</p>
  
  <pre><code>xpath Applications.xml '//applications/application[@mode='3']'/@name
  </code></pre>
  
  <p>But if I want to add more condtion which is "get name attribute value when mode=X and tool attribute is not there in application tag"</p>
  
  <p>How do we do this? I tried something like </p>
  
  <pre><code>xpath Applications.xml '//applications/application[@mode='3' and !@tool]'/@name
  </code></pre>
  
  <p>but its not working.</p>
  
  <p>I have not used XPath before and I am finding it tricky I search W3C help on XPath but did not find what I wanted. Please help.</p>