private static <T> T buildClass(Node node, String elementName, Class itemClass)
            throws TikaConfigException {
        String className = itemClass.getName();
        Node classNameNode = node.getAttributes().getNamedItem("class");

        if (classNameNode != null) {
            className = classNameNode.getTextContent();
        }
        try {
            Class clazz = Class.forName(className);
            if (!itemClass.isAssignableFrom(clazz)) {
                throw new TikaConfigException(
                        elementName + " with class name " + className + " must be of type '" +
                                itemClass.getName() + "'");
            }
            return (T) clazz.getDeclaredConstructor().newInstance();
        } catch (InstantiationException | IllegalAccessException | ClassNotFoundException |
                 NoSuchMethodException | InvocationTargetException e) {
            throw new TikaConfigException("problem loading " + elementName +
                    " with class " + itemClass.getName(), e);
        }
    }
Use this to build a list of components for a composite item (e.g.
CompositeMetadataFilter, FetcherManager), each with their own configurations

@param compositeElementName
@param itemName
@param is
@throws TikaConfigException
@throws IOException
tika-core/src/main/java/org/apache/tika/config/ConfigBase.java