$text = 'XML::LibXML::Text'->removeInvalidChars($str, $version)