private void renderWeightedSet(Inspector seq, int nestingLevel, boolean nestedarray) {
            int limit = seq.entryCount();
            renderTarget.append('\n');
            for (int i = 0; i < limit; ++i) {
                Inspector value  = nestedarray ? seq.entry(i).entry(0) : seq.entry(i).field("item");
                Inspector weight = nestedarray ? seq.entry(i).entry(1) : seq.entry(i).field("weight");
                long lw = 0;
                double dw = 0;
                if (weight.type() == Type.LONG) {
                    lw = weight.asLong();
                    dw = (double)lw;
                }
                if (weight.type() == Type.DOUBLE) {
                    dw = weight.asDouble();
                    lw = (long)dw;
                }
                indent(nestingLevel);
                renderTarget.append("<item weight=\"");
                if (dw == (double)lw || weight.type() == Type.LONG) {
                    renderTarget.append(lw);
                } else {
                    renderTarget.append(dw);
                }
                renderTarget.append("\">");
                renderInspector(value, nestingLevel);
                renderTarget.append("</item>\n");
            }
        }
Returns true if the given array represents a weighted set,
as a list of tuples
container-search/src/main/java/com/yahoo/prelude/hitfield/XmlRenderer.java