title: How to select all tags by XPath between the two tags if it needs to use relative path to the second tag
body: <p>I have such xml structure:</p>
  
  <pre><code>&lt;orange attr="orangeXXX"/&gt;
  
  &lt;apple attr="somedata" attr2="xxx"/&gt;
  &lt;apple attr="somedata" attr2="yyy"/&gt;
  ...
  &lt;apple attr="somedata" attr2="zzz"/&gt;
  
  &lt;orange attr="orangeYYY"/&gt;
  
  &lt;apple attr="somedata" attr2="aaa"/&gt;
  &lt;apple attr="somedata" attr2="bbb"/&gt;
  ...
  &lt;apple attr="somedata" attr2="ccc"/&gt;
  
  &lt;orange attr="orangeZZZ"/&gt;
  </code></pre>
  
  <p>I want to get all the tags between <code>&lt;orange attr="orangeXXX"/&gt;</code> and the next  tag after <code>&lt;orange attr="orangeYYY"/&gt;</code>:</p>
  
  <pre><code>&lt;apple attr="somedata" attr2="xxx"/&gt;
  &lt;apple attr="somedata" attr2="yyy"/&gt;
  ...
  &lt;apple attr="somedata" attr2="zzz"/&gt;
  </code></pre>
  
  <p>I created such XPath to get these tags:</p>
  
  <pre><code>/apple[@attr="somedata" and preceding-sibling::orange[@attr="orangeXXX"] 
                          and following-sibling::orange[@attr="orangeYYY"]]
  </code></pre>
  
  <p>The problem is that here I'm using direct attribute 'orangeYYY' but I want to avoid directly using of this attribute and use some relative constructions. </p>
  
  <p>Is it possible to make such XPath which can grep these tags between <code>&lt;orange attr="orangeXXX"/&gt;</code> and <code>&lt;orange attr="orangeYYY"/&gt;</code> without using "orangeYYY" value at all? </p>
  
  <p>Thank you!</p>