void renderInspector(Inspector value, int nestingLevel) {
            if (value.type() == Type.ARRAY) {
                renderMapOrArray(value, nestingLevel);
            } else if (value.type() == Type.OBJECT) {
                renderStruct(value, nestingLevel);
            } else if (value.type() == Type.STRING) {
                renderTarget.append(XML.xmlEscape(value.asString(), false));
            } else if (value.type() == Type.LONG) {
                long l = value.asLong();
                renderTarget.append(String.valueOf(l));
            } else if (value.type() == Type.DOUBLE) {
                double d = value.asDouble();
                renderTarget.append(String.valueOf(d));
            } else if (value.type() == Type.BOOL) {
                boolean b = value.asBool();
                renderTarget.append(b ? "true" : "false");
            } else if (value.type() == Type.DATA) {
                byte[] data = value.asData();
                renderTarget.append("<data length=\"").append(data.length);
                renderTarget.append("\" encoding=\"hex\">");
                for (int i = 0; i < data.length; i++) {
                    for (int sh = 4; sh >= 0; sh -= 4) {
                        int val = (data[i] >> sh) & 0xF;
                        char hexdigit = (val < 10) ? ((char)('0' + val)) : ((char)('A' + val - 10));
                        renderTarget.append(hexdigit);
                    }
                }
                renderTarget.append("</data>");
            }
        }
Utility class for converting accessible data into the historical "prelude" xml format.
container-search/src/main/java/com/yahoo/prelude/hitfield/XmlRenderer.java