service.setProperty( OutputKeys.ENCODING, "ISO-8859-1" );
service.setProperty( OutputKeys.ENCODING, "UTF-8" );
    public static void main( String args[] ) {        try {            if ( args.length < 1 )                usage();            Class cl = Class.forName( driver );            Database database = (Database) cl.newInstance();            database.setProperty( "create-database", "true" );            DatabaseManager.registerDatabase( database );            String collection = "/db";            String query;            if ( args.length == 2 ) {                // if collection does not start with "/" add it                collection = ( args[0].charAt( 0 ) == '/' ) ? args[0] : "/" + args[0];                query = args[1];            }            else                query = args[0];                        // get root-collection            Collection col =                DatabaseManager.getCollection( URI + collection );            // get query-service            XQueryService service =                (XQueryService) col.getService( "XQueryService", "1.0" );            // set pretty-printing on            service.setProperty( OutputKeys.INDENT, "yes" );            service.setProperty( OutputKeys.ENCODING, "ISO-8859-1" );            CompiledExpression compiled = service.compile( query );                        long start = System.currentTimeMillis();            // execute query and get results in ResourceSet            ResourceSet result = service.execute( compiled );            long qtime = System.currentTimeMillis() - start;            start = System.currentTimeMillis();            for ( int i = 0; i < (int) result.getSize(); i++ ) {                XMLResource resource = (XMLResource) result.getResource( (long) i );                 System.out.println( resource.getContent().toString() );            }            long rtime = System.currentTimeMillis() - start;			System.out.println("query:         " + query);			System.out.println("hits:          " + result.getSize());            System.out.println("query time:    " + qtime);            System.out.println("retrieve time: " + rtime);        } catch ( Exception e ) {            e.printStackTrace();        }    }