private void consumeFastInfoset(final FastInfosetValue fastInfosetValue, final String expectedXMLRegex) {
        LOGGER.info("Consuming fastInfosetValue");
        final Configuration configuration = new Configuration();
        final PipelineConfiguration pipelineConfiguration = new PipelineConfiguration(configuration);

        final StringWriter stringWriter = new StringWriter();
        final XMLEmitter xmlEmitter = new XMLEmitter();
        xmlEmitter.setPipelineConfiguration(pipelineConfiguration);
        try {
            xmlEmitter.setWriter(stringWriter);
        } catch (XPathException e) {
            throw new RuntimeException(e);
        }
        final FastInfosetByteBufferConsumer fastInfosetByteBufferConsumer = new FastInfosetByteBufferConsumer(
                xmlEmitter, pipelineConfiguration);

        final RefDataValueByteBufferConsumer.Factory refDataValueByteBufferConsumerFactory =
                (receiver, pipelineConfiguration1)
                        -> fastInfosetByteBufferConsumer;

        final OffHeapRefDataValueProxyConsumer offHeapRefDataValueProxyConsumer = new OffHeapRefDataValueProxyConsumer(
                xmlEmitter,
                pipelineConfiguration,
                Map.of(new ByteBufferConsumerId(FastInfosetValue.TYPE_ID), refDataValueByteBufferConsumerFactory));

        final OffHeapRefDataValueProxyConsumer.Factory offHeapRefDataValueProxyConsumerFactory =
                (receiver, pipelineConfiguration12)
                        -> offHeapRefDataValueProxyConsumer;

        final RefDataValueProxyConsumerFactory refDataValueProxyConsumerFactory = new RefDataValueProxyConsumerFactory(
                xmlEmitter,
                pipelineConfiguration,
                null,
                offHeapRefDataValueProxyConsumerFactory);

        final GenericRefDataValueProxyConsumer genericRefDataValueProxyConsumer = new GenericRefDataValueProxyConsumer(
                xmlEmitter, pipelineConfiguration, refDataValueProxyConsumerFactory);

        final RefDataValueProxy refDataValueProxy = new RefDataValueProxy() {

            @Override
            public String getKey() {
                return null;
            }

            @Override
            public String getMapName() {
                return null;
            }

            @Override
            public List<MapDefinition> getMapDefinitions() {
                return null;
            }

            @Override
            public Optional<MapDefinition> getSuccessfulMapDefinition() {
                return Optional.empty();
            }

            @Override
            public Optional<RefDataValue> supplyValue() {
                return Optional.of(fastInfosetValue);
            }

            @Override
            public boolean consumeBytes(final Consumer<TypedByteBuffer> typedByteBufferConsumer) {
                final TypedByteBuffer typedByteBuffer = new TypedByteBuffer(FastInfosetValue.TYPE_ID,
                        fastInfosetValue.getByteBuffer());
                typedByteBufferConsumer.accept(typedByteBuffer);
                return true;
            }

            @Override
            public boolean consumeValue(final RefDataValueProxyConsumerFactory refDataValueProxyConsumerFactory) {
                final RefDataValueProxyConsumer refDataValueProxyConsumer = refDataValueProxyConsumerFactory
                        .getConsumer(StorageType.OFF_HEAP);
                try {
                    return refDataValueProxyConsumer.consume(this);
                } catch (XPathException e) {
                    throw new RuntimeException(LogUtil.message(
                            "Error handling reference data value: {}", e.getMessage()), e);
                }
            }

            @Override
            public RefDataValueProxy merge(final RefDataValueProxy additionalProxy) {
                return MultiRefDataValueProxy.merge(this, additionalProxy);
            }
        };

        try {
            genericRefDataValueProxyConsumer.startDocument();
            genericRefDataValueProxyConsumer.consume(refDataValueProxy);
            genericRefDataValueProxyConsumer.endDocument();
        } catch (XPathException e) {
            e.printStackTrace();
        }

        final String xml = stringWriter.toString();
        LOGGER.info("==================");
        LOGGER.info("Output:\n{}", xml);

        Assertions.assertThat(xml)
                .matches(expectedXMLRegex);

        // Flip the buffer for the next reader
        fastInfosetValue.getByteBuffer().flip();
    }
Consume the fastInfosetValue using the various classes used in ref data lookup
stroom-pipeline/src/test/java/stroom/pipeline/refdata/TestReferenceDataFilter.java