in reply to Help with HTML::Element->splice_content
Regardless of which it is, the HTML::TreeBuilder objectify_text method will probably be of use.