title: XML xpath, get the parent element till a specific element
body: <p>I'm looking for the right xpath syntax to get a specific parent of an element.
  Example:</p>
  
  <pre><code>root
     |- div
     |     |
     |     |----??? ---|
     |     |           |-a [class=1]
     |     |                      |- text[ A TEXT I DON'T WANT]
     |     |
     |     |
     |     |
     |     |-text[THE TEXT]
     |
     |-div 
     |    |-text[THE TEXT I DON'T WANT]
     |
     |-div 
     |    |-text[THE TEXT I DON'T WANT]
  </code></pre>
  
  <p>I want to get the text "THE TEXT" but the one that contains <code>a [class=1]</code> inside the same div. Something like this:</p>
  
  <pre><code>//div//a[@class=1]/text[contains(.,'A TEXT')]/parent::*/parent::*.... &lt;till div element&gt;  /text
  </code></pre>