Parsing HTML in python – lxml or BeautifulSoup? Which of these is better for what kinds of purposes?

From what I can make out, the two main HTML parsing libraries in Python are lxml and BeautifulSoup. I’ve chosen BeautifulSoup for a project I’m working on, but I chose it for no particular reason other than finding the syntax a bit easier to learn and understand. But I see a lot of people seem to favour lxml and I’ve heard that lxml is faster.

Get all text inside a tag in lxml

I’d like to write a code snippet that would grab all of the text inside the <content> tag, in lxml, in all three instances below, including the code tags. I’ve tried tostring(getchildren()) but that would miss the text in between the tags. I didn’t have very much luck searching the API for a relevant function. Could you help me out?