QName qname = actualClass == Document.class ? null : getQName(actualClass, genericType, actualObject);
if (qname != null && ignoreNamespaces && (isCollection || dropRootNeeded)) {
qname = new QName(qname.getLocalPart());
}
Configuration config =
JSONUtils.createConfiguration(namespaceMap,
writeXsiType && !ignoreNamespaces,
attributesToElements,
typeConverter);
if (!dropElementsInXmlStream && super.outDropElements != null) {
config.setIgnoredElements(outDropElements);
}
if (!writeNullAsString) {
config.setWriteNullAsString(writeNullAsString);
}
if (dropRootElement && !dropElementsInXmlStream) {
config.setDropRootElement(true);
}
if (ignoreNamespaces && serializeAsArray && arrayKeys == null) {
arrayKeys = CastUtils.cast((List<?>)Collections.singletonList(qname.getLocalPart()));
}
XMLStreamWriter writer = JSONUtils.createStreamWriter(os, qname,