code: public TransformerFactory configure(TransformerFactory factory) {
          for (Map.Entry<String, Object> attr : attributes.entrySet()) {
              try {
                  factory.setAttribute(attr.getKey(), attr.getValue());
              } catch (IllegalArgumentException ex) {
                  throw new ConfigurationException("Error setting attribute " + attr.getKey(), ex);
              }
          }
          for (Map.Entry<String, Object> attr : safeAttributes.entrySet()) {
              try {
                  factory.setAttribute(attr.getKey(), attr.getValue());
              } catch (IllegalArgumentException ex) {
                  // swallow
              }
          }
          for (Map.Entry<String, Boolean> feat : features.entrySet()) {
              try {
                  factory.setFeature(feat.getKey(), feat.getValue());
              } catch (TransformerConfigurationException ex) {
                  throw new ConfigurationException("Error setting feature " + feat.getKey(), ex);
              }
          }
          for (Map.Entry<String, Boolean> feat : safeFeatures.entrySet()) {
              try {
                  factory.setFeature(feat.getKey(), feat.getValue());
              } catch (TransformerConfigurationException ex) {
                  // swallow
              }
          }
          return factory;
      }
docs: Applies the current configuration.
  
  @throws ConfigurationException if any of the attributes or
  features set is not supported.