private Scriptable getJSONAsXML() throws CarbonException {
OMSourcedElementImpl sourcedElement = (OMSourcedElementImpl) responseXML;
if (sourcedElement.getDataSource() != null) {
try {
String jsonString = sourcedElement.toStringWithConsume();
while (jsonString.indexOf("<?") == 0) {
jsonString = jsonString.substring(jsonString.indexOf("?>") + 2);
}
Object[] objects = {jsonString};
return context.newObject(this, "XML", objects);