title: Is there any method to delete node using XPATH based on one attribute and node value?
body: <p>I am trying to delete a node using XPATH and php, while coming two XPATH queries.</p>
  
  <p>I am using php 5 for such problem. I tried to use DOMDocument with no luck.</p>
  
  <pre><code>enter code here
  //The php file
  $xml_str = file_get_contents("projectTest.xml");
  $xml = new SimpleXMLElement($xml_str);
  
  
  echo $xml-&gt;saveXML();
  unset($xml-&gt;xpath("/project/Item/username[@date='2019-04-20'] and 
  /project/Item/username/clientID[text()=='10000']")[0]-&gt;{0});
  echo $xml-&gt;saveXML();
  
  
  
  //The XML File
  &lt;project&gt;   
     &lt;Item&gt;
       &lt;username date="2019-04-20"&gt;
        &lt;clientID&gt;10000&lt;/clientID&gt;
       &lt;/username&gt;
       &lt;name&gt;Test1&lt;/name&gt;
       &lt;price&gt;200&lt;/price&gt;
       &lt;quantity&gt;1&lt;/quantity&gt;
    &lt;/Item&gt;
    &lt;Item&gt;
      &lt;username date="2019-06-23"&gt;
        &lt;clientID&gt;3&lt;/clientID&gt;
      &lt;/username&gt;
      &lt;name&gt;Test2&lt;/name&gt;
       &lt;price&gt;200&lt;/price&gt;
     &lt;quantity&gt;1&lt;/quantity&gt;
  
   &lt;/Item&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>enter code here
  
  &lt;!-------- Expected:
    &lt;project&gt;
      &lt;Item&gt;
         &lt;username date="2019-06-23"&gt;
           &lt;clientID&gt;3&lt;/clientID&gt;
         &lt;/username&gt;
         &lt;name&gt;Test2&lt;/name&gt;
         &lt;price&gt;200&lt;/price&gt;
        &lt;quantity&gt;1&lt;/quantity&gt;
  
     &lt;/Item&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Actual results:
  The above code is generating errors.
  P.S: I just started to learn how to use XPATH, i am having problem in understanding how the syntax works.</p>