@Converter(fallback = true)
    public static <T> T convertTo(Class<T> type, Exchange exchange, Object value, TypeConverterRegistry registry) {
        if (NodeInfo.class.isAssignableFrom(value.getClass())) {
            // use a fallback type converter so we can convert the embedded body if the value is NodeInfo
            NodeInfo ni = (NodeInfo) value;
            // first try to find a Converter for Node
            TypeConverter tc = registry.lookup(type, Node.class);
            if (tc != null) {
                Node node = NodeOverNodeInfo.wrap(ni);
                return tc.convertTo(type, exchange, node);
            }
            // if this does not exist we can also try NodeList (there are some type converters for that) as
            // the default Xerces Node implementation also implements NodeList.
            tc = registry.lookup(type, NodeList.class);
            if (tc != null) {
                List<NodeInfo> nil = new LinkedList<>();
                nil.add(ni);
                return tc.convertTo(type, exchange, toDOMNodeList(nil));
            }
        } else if (List.class.isAssignableFrom(value.getClass())) {
            TypeConverter tc = registry.lookup(type, NodeList.class);
            if (tc != null) {
                List<NodeInfo> lion = new LinkedList<>();
                for (Object o : (List<?>) value) {
                    if (o instanceof NodeInfo) {
                        lion.add((NodeInfo) o);
                    }
                }
                if (!lion.isEmpty()) {
                    NodeList nl = toDOMNodeList(lion);
                    return tc.convertTo(type, exchange, nl);
                }
            }
        } else if (NodeOverNodeInfo.class.isAssignableFrom(value.getClass())) {
            // NodeOverNode info is a read-only Node implementation from Saxon. In contrast to the JDK
            // com.sun.org.apache.xerces.internal.dom.NodeImpl class it does not implement NodeList, but
            // many Camel type converters are based on that interface. Therefore we convert to NodeList and
            // try type conversion in the fallback type converter.
            TypeConverter tc = registry.lookup(type, NodeList.class);
            if (tc != null) {
                List<Node> domNodeList = new LinkedList<>();
                domNodeList.add((NodeOverNodeInfo) value);
                return tc.convertTo(type, exchange, new DOMNodeList(domNodeList));
            }
        }

        return null;
    }
@Test
    public void convertToNode() {
        Node node = context.getTypeConverter().convertTo(Node.class, exchange, doc);
        assertNotNull(node);
        String string = context.getTypeConverter().convertTo(String.class, exchange, node);
        assertEquals(CONTENT, string);
    }