title: Extract nodes based on attribute and node values
body: <p>For the below XML, I'm trying to extract the nodes based on attribute and node values. </p>
  
  <p>Based on attribute class=pass and h1 contains ('objectives'), I'm trying to extract the below output.</p>
  
  <p>"objectives" is a part of the node value string "1 task objectives"</p>
  
  <p>1 task objectives
  object1
  object2</p>
  
  <pre><code>&lt;body&gt;
    &lt;article&gt;
      &lt;body&gt;
        &lt;section&gt;
          &lt;h1&gt;intro1&lt;/h1&gt;
          &lt;region&gt;introd1&lt;/region&gt;
          &lt;region&gt;introd2&lt;/region&gt;
        &lt;/section&gt;
        &lt;section&gt;
          &lt;h1 class="pass"&gt;1 task objectives&lt;/h1&gt;
          &lt;region&gt;object1&lt;/region&gt;
          &lt;region&gt;object2&lt;/region&gt;
        &lt;/section&gt;
      &lt;/body&gt;
    &lt;/article&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Below is the XPath expression I am trying. However, this is not giving any output. Can you please point out what I am doing wrong?</p>
  
  <pre><code>//body//section//h1[contains(.,'objectives') and @class="pass"]/*/text()
  </code></pre>
  
  <p>Thanks &amp; Regards,
  Simak</p>