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

No need for the else block (as early return is present)