title: How to get owner element of a text node?
body: <p>I have this data:</p>
  
  <pre><code>&lt;data&gt;
    &lt;foo&gt;foo text&lt;/foo&gt;
    data text
      &lt;bar&gt;
        bar text
        &lt;baz&gt;text&lt;/baz&gt;
        &lt;baz&gt;text&lt;/baz&gt;
        bar text
      &lt;/bar&gt;
     data text
  &lt;/data&gt;
  </code></pre>
  
  <p>and I need get all text values in order, modify text inside "baz" tag and print. My code is:</p>
  
  <pre><code>text = []
  for element in etree.xpath("./*"):
      text.extend(element.xpath("./text()"))
      if element.tag == 'bar':
          text.extend(["baz " + s for s in element.xpath("./baz/text()")])
  print '\n'.join([s.strip() for s in text if s.strip()])
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>foo text
  bar text
  bar text
  baz text
  baz text
  </code></pre>
  
  <p>but I need:</p>
  
  <pre><code>foo text
  data text
  bar text
  baz text
  baz text
  bar text
  data text
  </code></pre>
  
  <p>How can I get <code>text()</code> of node in order and without lost <code>data text</code> text?</p>
  
  <p><strong>Edit</strong>
  I know about <code>etree.xpath(".//text()")</code> which can give me all text in order, but
  I need to modify text inside <code>baz</code> tag. This is a point. How can I get tag value of every element of <code>.//text()</code> XPath?</p>