config.setProperty(FunctionFactory.PROPERTY_DISABLE_DEPRECATED_FUNCTIONS, new Boolean(false));
BrokerPool.configure(1, 5, config);
// initialize driver
Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
Database database = (Database) cl.newInstance();
database.setProperty("create-database", "true");
DatabaseManager.registerDatabase(database);
Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
CollectionManagementService service =
(CollectionManagementService) root.getService("CollectionManagementService", "1.0");