private static ServiceLoader serviceLoaderFromDomElement(Element element, ClassLoader loader)
            throws TikaConfigException {
        Element serviceLoaderElement = getChild(element, "service-loader");
        ServiceLoader serviceLoader;

        if (serviceLoaderElement != null) {
            boolean dynamic = Boolean.parseBoolean(serviceLoaderElement.getAttribute("dynamic"));
            LoadErrorHandler loadErrorHandler = LoadErrorHandler.THROW;
            String loadErrorHandleConfig = serviceLoaderElement.getAttribute("loadErrorHandler");
            if (LoadErrorHandler.WARN.toString().equalsIgnoreCase(loadErrorHandleConfig)) {
                loadErrorHandler = LoadErrorHandler.WARN;
            } else if (LoadErrorHandler.IGNORE.toString().equalsIgnoreCase(loadErrorHandleConfig)) {
                loadErrorHandler = LoadErrorHandler.IGNORE;
            }
            InitializableProblemHandler initializableProblemHandler =
                    getInitializableProblemHandler(
                            serviceLoaderElement.getAttribute("initializableProblemHandler"));

            if (loader == null) {
                loader = ServiceLoader.getContextClassLoader();
            }
            serviceLoader = new ServiceLoader(loader, loadErrorHandler, initializableProblemHandler,
                    dynamic);
        } else if (loader != null) {
            serviceLoader = new ServiceLoader(loader);
        } else {
            serviceLoader = new ServiceLoader();
        }
        return serviceLoader;
    }
Provides a default configuration (TikaConfig).  Currently creates a
new instance each time it's called; we may be able to have it
return a shared instance once it is completely immutable.

@return default configuration
tika-core/src/main/java/org/apache/tika/config/TikaConfig.java