Source src = new DOMSource(item.getRoot());
String xml = DomUtils.toXml(src, 4);
data = xml;
} else if (o instanceof UntypedItemJson) {
UntypedItemJson item = (UntypedItemJson) o;
JSONObject root = item.getRoot();
try {
data = root.toString(2);
} catch (JSONException e) {
throw new IllegalStateException("Error formatting JSON", e);
}