Configuration config,
boolean serializeAsArray,
List<String> arrayKeys,
boolean dropRootElement) throws Exception {
MappedNamespaceConvention convention = new PrefixRespectingMappedNamespaceConvention(config);
AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
convention,
new OutputStreamWriter(os, UTF8));
if (serializeAsArray) {
if (arrayKeys != null) {