remapDefaultNamespace(tree, tagDoc);
}
} else if ("application/json".equals(contentType) || "text/json".equals(contentType)) {
JSONTokener jt = new JSONTokener(escapedContent);
XdmNode jsonDoc = JSONtoXML.convert(runtime.getProcessor(), jt, runtime.jsonFlavor());
tree.addSubtree(jsonDoc);
} else if (!"application/xml".equals(contentType)) {
throw XProcException.stepError(51);
} else {
// Put a wrapper around it so that it doesn't have to have a single root...
escapedContent = "<wrapper>" + escapedContent + "</wrapper>";