code: private List<MetadataResolver> buildSingleMetadataResolver(final MetadataFilter metadataFilterChain, final Resource resource, final Document document) {
          try {
              val metadataRoot = document.getDocumentElement();
              val metadataProvider = new DOMMetadataResolver(metadataRoot);
              metadataProvider.setParserPool(this.configBean.getParserPool());
              metadataProvider.setFailFastInitialization(true);
              metadataProvider.setRequireValidMetadata(this.requireValidMetadata);
              metadataProvider.setId(metadataProvider.getClass().getCanonicalName());
              if (metadataFilterChain != null) {
                  metadataProvider.setMetadataFilter(metadataFilterChain);
              }
              LOGGER.debug("Initializing metadata resolver for [{}]", resource);
              metadataProvider.initialize();
              val resolvers = new ArrayList<MetadataResolver>();
              resolvers.add(metadataProvider);
              return resolvers;
          } catch (final Exception ex) {
              LOGGER.warn("Could not initialize metadata resolver. Resource will be ignored", ex);
          }
          return new ArrayList<>(0);
      }
docs: Build single metadata resolver.
  
  @param metadataFilterChain the metadata filters chained together
  @param resource            the resource
  @param document            the xml document to parse
  @return list of resolved metadata from resources.