Fix detect struct array, add options for encoding, etc into serializers. add wrapper for handle CData in XmlWriter

Why can `$escaping` be either an array or a scalar value?