The isValidValue() method of the Array2XML class prohibits too many characters, which contradicts the W3C recommendations for XML (https://www.w3.org/TR/xml/#NT-Char). As a result, characters that are valid according to the specification are treated as invalid. I suggest adapting the isValidValue() function to comply with the current W3C recommendations. One of the issues I personally encountered is that emojis (such as country flags) cannot be processed correctly for this reason, causing the class to throw an exception.
If approved, I will submit a PR with the changes. The changes should not break backward compatibility and can be included in a minor release, as they expand rather than restrict the set of characters accepted by the validation.