question: private XPathFactory loadFromServicesFile ( String uri , String resourceName , InputStream in ) { if ( debug ) debugPrintln ( "Reading " + resourceName ) ; BufferedReader rd ; try { rd = new BufferedReader ( new InputStreamReader ( in , "UTF-8" ) , DEFAULT_LINE_LENGTH ) ; } catch ( java . io . UnsupportedEncodingException e ) { rd = new BufferedReader ( new InputStreamReader ( in ) , DEFAULT_LINE_LENGTH ) ; } String factoryClassName ; XPathFactory resultFactory = null ; while ( true ) { try { factoryClassName = rd . readLine ( ) ; } catch ( IOException x ) { break ; } if ( factoryClassName != null ) { int hashIndex = factoryClassName . indexOf ( '#' ) ; if ( hashIndex != - 1 ) { factoryClassName = factoryClassName . substring ( 0 , hashIndex ) ; } factoryClassName = factoryClassName . trim ( ) ; if ( factoryClassName . length ( ) == 0 ) { continue ; } try { XPathFactory foundFactory = createInstance ( factoryClassName ) ; if ( foundFactory . isObjectModelSupported ( uri ) ) { resultFactory = foundFactory ; break ; } } catch ( Exception ignored ) { } } else { break ; } } IoUtils . closeQuietly ( rd ) ; return resultFactory ; }
target:  Searches for a XPathFactory for a given uri in a META-INF/services file. 