System.out.println("found: " + result.getSize());
    public static void main( String args[] ) {    	if(args.length == 2) {    		query = args[0];    		sortBy = args[1];    	}    	System.out.println("Query: " + query);    	System.out.println("Sort-by: " + sortBy);        try {            Class cl = Class.forName( driver );            Database database = (Database) cl.newInstance();            database.setProperty( "create-database", "true" );            DatabaseManager.registerDatabase( database );            // get root-collection            Collection col =                DatabaseManager.getCollection( URI + "/db" );            // get query-service            XPathQueryServiceImpl service = (XPathQueryServiceImpl)             	col.getService( "XPathQueryService", "1.0" );            // set pretty-printing on            service.setProperty( OutputKeys.INDENT, "yes" );            service.setProperty( OutputKeys.ENCODING, "ISO-8859-1" );            // execute query and get results in ResourceSet            ResourceSet result = service.query( query, sortBy );            // create iterator            for(ResourceIterator i = result.getIterator(); i.hasMoreResources(); ) {                XMLResource resource = (XMLResource) i.nextResource();                String xml = resource.getContent().toString();                System.out.println( xml );            }        } catch ( Exception e ) {            e.printStackTrace();        }    }