truncate-escaped-html

Converts special characters in a string to the corresponding HTML entities, then truncates the resulting string carefully (HTML entities are not cut in the middle).

xmldecode

Decode the predefined XML entities (amp, lt, gt, apos, quot), CharRefs and CDATA sections.