So this is used to wrap anything that contains invalid XML characters in CDATA? I think this could be converted to use strpbrk: http://www.php.net/manual/en/function.strpbrk.php.

```php
if (strpbrk($value, '<>&')) {
    // ...
}
```