That's often referred to as "inner xml" rather than "inner text". This is one possible way to get inner xml of an element :
import lxml.etree as etree
import lxml.html
html = "<p>this is <b>the</b> good stuff<p>"
tree = lxml.html.fromstring(html)
node = tree.xpath("//p")[0]
result = node.text + ''.join(etree.tostring(e) for e in node)
print(result)
That's often referred to as "inner xml" rather than "inner text". This is one possible way to get inner xml of an element :
output :