private static void setParams(Object object, Node targetNode, Set<String> settings,
                                  String exceptNodeName) throws TikaConfigException {
        NodeList children = targetNode.getChildNodes();
        List<Node> params = new ArrayList<>();
        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);

            if ("params".equals(child.getLocalName())) {
                NodeList paramsList = child.getChildNodes();
                for (int j = 0; j < paramsList.getLength(); j++) {
                    params.add(paramsList.item(j));
                }
            } else {
                params.add(child);
            }
        }
        for (int i = 0; i < params.size(); i++) {
            Node param = params.get(i);
            if (param.getNodeType() != 1) {
                continue;
            }
            String localName = param.getLocalName();
            if (localName == null || localName.equals(exceptNodeName)) {
                continue;
            }
            String txt = param.getTextContent();
            String itemName = param.getLocalName();
            SetterClassPair setterClassPair = findSetterClassPair(object, itemName);
            boolean processed = false;
            if (!hasClass(param)) {
                if (setterClassPair.itemClass.isAssignableFrom(Map.class) && isMap(param)) {
                    tryToSetMap(object, param);
                    processed = true;
                } else if (setterClassPair.itemClass.isAssignableFrom(List.class)) {
                    tryToSetList(object, param);
                    processed = true;
                }
            }
            if (!processed) {
                if (isPrimitive(setterClassPair.itemClass)) {
                    tryToSetPrimitive(object, setterClassPair, param.getTextContent());
                } else {
                    //tryToSetPrimitive(object, localName, txt);
                    Object item = buildClass(param, itemName, setterClassPair.itemClass);
                    setParams(setterClassPair.itemClass.cast(item), param, new HashSet<>());
                    try {
                        setterClassPair.setterMethod.invoke(object, item);
                    } catch (IllegalAccessException | InvocationTargetException e) {
                        throw new TikaConfigException("problem creating " + itemName, e);
                    }
                }
            }

            if (txt != null) {
                settings.add(localName);
            }
        }

        if (object instanceof Initializable) {
            ((Initializable) object).initialize(Collections.EMPTY_MAP);
            ((Initializable) object).checkInitialization(InitializableProblemHandler.THROW);
        }
    }
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