title: How can I select only the immediate parent node of a text string using xpath
body: <p>Given the following html:</p>
  
  <pre><code>&lt;html&gt;
   &lt;body&gt;
    &lt;div&gt;
     &lt;p&gt;During the interim there shall be nourishment supplied&lt;/p&gt;
    &lt;/div&gt;
    &lt;div&gt;
     &lt;a href="/interim"&gt;In the interim&lt;/a&gt;
    &lt;/div&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the following xpath:</p>
  
  <pre><code>//*[contains(.,'interim')]
  </code></pre>
  
  <p>The elements returned by this include the HTML tag, the BODY tag, etc. So every ancestor parent is returned. </p>
  
  <p>I only want the immediate container nodes, i.e. the P and the A.</p>