code: private XPathFactory _newFactory(String uri) {
          XPathFactory xpf;
          String propertyName = SERVICE_CLASS.getName() + ":" + uri;
  
          // system property look up
          try {
              if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
              String r = System.getProperty(propertyName);
              if (r != null && r.length() > 0) {
                  if (debug) debugPrintln("The value is '"+r+"'");
                  xpf = createInstance(r);
                  if(xpf!=null)    return xpf;
              } else if (debug) {
                  debugPrintln("The property is undefined.");
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          // try to read from $java.home/lib/jaxp.properties
          try {
              String factoryClassName = CacheHolder.cacheProps.getProperty(propertyName);
              if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
  
              if (factoryClassName != null) {
                  xpf = createInstance(factoryClassName);
                  if(xpf != null){
                      return xpf;
                  }
              }
          } catch (Exception ex) {
              if (debug) {
                  ex.printStackTrace();
              }
          }
  
          // try META-INF/services files
          for (URL resource : createServiceFileIterator()) {
              if (debug) debugPrintln("looking into " + resource);
              try {
                  xpf = loadFromServicesFile(uri, resource.toExternalForm(), resource.openStream());
                  if(xpf!=null)    return xpf;
              } catch(IOException e) {
                  if( debug ) {
                      debugPrintln("failed to read "+resource);
                      e.printStackTrace();
                  }
              }
          }
  
          // platform default
          if(uri.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
              if (debug) debugPrintln("attempting to use the platform default W3C DOM XPath lib");
              return createInstance("org.apache.xpath.jaxp.XPathFactoryImpl");
          }
  
          if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
          return null;
      }
docs: <p>Lookup a {@link XPathFactory} for the given object model.</p>
  
  @param uri identifies the object model.