title: XPath with XPath operators
body: <p>I am interested in finding if there is a way to add an XPath as part of operand while evaluating another XPath.</p>
  
  <p>Consider the following XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;bookStore&gt;
      &lt;bestSellerId&gt;3&lt;/bestSellerId&gt;
      &lt;book&gt;
          &lt;bookId&gt;1&lt;/bookId&gt;
          &lt;bookName&gt;First Book&lt;/bookName&gt;
          &lt;bookAuthor&gt;First Author&lt;/bookAuthor&gt;
      &lt;/book&gt;
      &lt;book&gt;
          &lt;bookId&gt;2&lt;/bookId&gt;
          &lt;bookName&gt;Second Book&lt;/bookName&gt;
          &lt;bookAuthor&gt;Second Author&lt;/bookAuthor&gt;
      &lt;/book&gt;
      &lt;book&gt;
          &lt;bookId&gt;3&lt;/bookId&gt;
          &lt;bookName&gt;Third Book&lt;/bookName&gt;
          &lt;bookAuthor&gt;Third Author&lt;/bookAuthor&gt;
      &lt;/book&gt;
      &lt;book&gt;
          &lt;bookId&gt;4&lt;/bookId&gt;
          &lt;bookName&gt;Fouth Book&lt;/bookName&gt;
          &lt;bookAuthor&gt;Fouth Author&lt;/bookAuthor&gt;
      &lt;/book&gt;
  &lt;/bookStore&gt;
  </code></pre>
  
  <p>I need to fetch the <code>bookAuthor</code> of the bestseller which can be determined using the <code>bestSellerId</code>.</p>
  
  <p>I am trying the following but am not getting any match:</p>
  
  <pre><code>bookStore/book[bookId=bookStore/bestSellerId/text()]/bookAuthor
  </code></pre>