title: Getting Xpath node values in nested XML
body: <p>My xml structure is like,</p>
  
  <pre><code>&lt;items&gt;
  &lt;item&gt;
      &lt;brand&gt;
          &lt;id&gt; 3 &lt;/id&gt;
       &lt;/brand&gt;
      &lt;product&gt;
          &lt;productType&gt;Type 1&lt;/productType&gt;
      &lt;/product&gt;
  &lt;/item&gt;
  &lt;item&gt;
      &lt;brand&gt;
          &lt;id&gt; 4 &lt;/id&gt;
       &lt;/brand&gt;
      &lt;product&gt;
          &lt;productType&gt;Type 2&lt;/productType&gt;
      &lt;/product&gt;
  &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I need to get the product type value if the user provides the brand id. For eg, if the user enters brand id 3, then I need to return the product type <strong>Type 1</strong></p>
  
  <p>I tried with Xpath expression</p>
  
  <pre><code> /items/item/brand[id = 3]/product/productType
  </code></pre>
  
  <p>But it does not work. What will be the correct xpath expression.</p>