title: Derive value using single xpath expression
body: <p>I have an xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;library&gt;
      &lt;ChildEntity&gt;
          &lt;EntityID&gt;9099-77-005&lt;/EntityID&gt;
          &lt;ChildEntity&gt;
              &lt;EntityID&gt;005&lt;/EntityID&gt;
          &lt;/ChildEntity&gt;
              &lt;ChildEntity&gt;
                  &lt;CharacteristicUse&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;123&lt;/ValueID&gt;
                      &lt;/Value&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;567&lt;/ValueID&gt;
                      &lt;/Value&gt;
                  &lt;/CharacteristicUse&gt;
                  &lt;CharacteristicUse&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;555&lt;/ValueID&gt;
                      &lt;/Value&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;5677&lt;/ValueID&gt;
                      &lt;/Value&gt;
                  &lt;/CharacteristicUse&gt;
              &lt;/ChildEntity&gt;
      &lt;/ChildEntity&gt;
      &lt;ChildEntity&gt;
          &lt;EntityID&gt;8888-77-005&lt;/EntityID&gt;
          &lt;ChildEntity&gt;
              &lt;EntityID&gt;88005&lt;/EntityID&gt;
          &lt;/ChildEntity&gt;
              &lt;ChildEntity&gt;
                  &lt;CharacteristicUse&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;99123&lt;/ValueID&gt;
                      &lt;/Value&gt;
                      &lt;Value&gt;
                          &lt;ValueID&gt;59967&lt;/ValueID&gt;
                      &lt;/Value&gt;
                  &lt;/CharacteristicUse&gt;
              &lt;/ChildEntity&gt;
      &lt;/ChildEntity&gt;
  &lt;/library&gt;
  </code></pre>
  
  <p>out of which i want to derive the tags:</p>
  
  <pre><code>&lt;Value&gt;
      &lt;ValueID&gt;567&lt;/ValueID&gt;
  &lt;/Value&gt;
  </code></pre>
  
  <p>such that this will be then used to remove from the xml later on.</p>
  
  <p>The logic should be such that, derive and remove the tags which has EntityID = 9099-77-005 and it should pick only that tag whose immediate sibling Value/ValueID!=123.</p>
  
  <p>I am new to Xpath and so far have only been able code:</p>
  
  <p>/library/ChildEntity[EntityID='9099-77-005']/ChildEntity/CharacteristicUse[Value[ValueID='123']] | /Value[ValueID!=123]</p>
  
  <p>Can someone please help?</p>