InfiniteLoop has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,
 Recently I have been tasked with modifying my custom module to output "clean html", given the following html snippet:
<B>TEXT</B><BR>Foo & BAR
has to be formatted thusly:
<B>TEXT</B><BR>FOO &amp; BAR
basically, I need to convert the "text" to their html entity, at the same time retaining the html tags. I have looked at few modules on CPAN, namely: I liked the HTML::Tidy, except for the fact, that it required libtidy, and I might not be able to package libtidy as part of the release.

Regards to HTML::Lint, the documentation does not give any methods to access the cleaned html chunk.

Do you know of any "all perl" html tidy like module ?