if (responseText == null && responseXML != null) {
// If the response is something like JSON calling toString on it wont work. We need to
// call toStringWithConsume instead, the following checks are checking for this
// condition.
if (responseXML instanceof OMSourcedElementImpl) {
OMSourcedElementImpl sourcedElement = (OMSourcedElementImpl) responseXML;
OMDataSource dataSource = sourcedElement.getDataSource();
if (dataSource != null && dataSource instanceof JSONDataSource) {
JSONDataSource jsonDataSource = (JSONDataSource) dataSource;
responseText = jsonDataSource.getCompleteJOSNString();
}
} else {