private Result getResult() {
        try {
            return (Result) getResponse();
        } catch (ClassCastException e) {
            throw new IllegalStateException("XmlRenderer attempted used outside a search context, got a " +
                                            getResponse().getClass().getName());
        }
    }
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