title: How delete tag from node in lxml without tail?
body: <p>Example:</p>
  
  <pre><code>html = &lt;a&gt;&lt;b&gt;Text&lt;/b&gt;Text2&lt;/a&gt;
  </code></pre>
  
  <p>BeautifullSoup code</p>
  
  <pre><code>[x.extract() for x in html.findAll(.//b)]
  </code></pre>
  
  <p>in exit we have:</p>
  
  <pre><code>html = &lt;a&gt;Text2&lt;/a&gt;
  </code></pre>
  
  <p>Lxml code:</p>
  
  <pre><code>[bad.getparent().remove(bad) for bad in html.xpath(".//b")]
  </code></pre>
  
  <p>in exit we have:</p>
  
  <pre><code>html = &lt;a&gt;&lt;/a&gt;
  </code></pre>
  
  <p>because lxml think "Text2" it's a tail of <code>&lt;b&gt;&lt;/b&gt;</code></p>
  
  <p>If we need only text line from join of tags we can use:</p>
  
  <pre><code>for bad in raw.xpath(xpath_search):
      bad.text = ''
  </code></pre>
  
  <p>But, how do that without changing text, but remove tags without tail?</p>