protected static Optional<String> getAsSerialisedXmlString(final Sequence sequence) {
        return Optional.ofNullable(sequence)
                .map(sequence2 -> {
                    if (sequence2 instanceof EmptyAtomicSequence) {
                        return null;
                    } else if (sequence2 instanceof NodeInfo) {
                        try {
                            final String xml = QueryResult.serialize((NodeInfo) sequence2);
                            LOGGER.debug("Got XML value:\n{}", xml);
                            return xml;
                        } catch (XPathException e) {
                            throw new RuntimeException("Error serialising nodeInfo - "
                                                       + e.getMessage(), e);
                        }
                    } else {
                        return sequence.toString();
                    }
                });
    }
Assert the number of times {@link ErrorReceiver#log(Severity, Location, String, String, Throwable)}
is called and get all the call args.

@param callCount Expected number of calls
@return All args used in the calls
stroom-pipeline/src/test/java/stroom/pipeline/xsltfunctions/AbstractXsltFunctionTest.java