private String asXML(Object value) {
        if (value == null)
            return "(null)";
        else if (value instanceof XmlProducer)
            return ((XmlProducer)value).toXML();
        else if (value instanceof HitField)
            return ((HitField)value).quotedContent(false);
        else if (value instanceof StructuredData || value instanceof XMLString || value instanceof JSONString)
            return value.toString();
        else
            return XML.xmlEscape(value.toString(), false, '\u001f');
    }
Creates an XML renderer using a custom executor.
Using a custom executor is useful for tests to avoid creating new threads for each renderer registry.
container-search/src/main/java/com/yahoo/search/rendering/XmlRenderer.java