final Database database = (Database) cl.newInstance();
DatabaseManager.registerDatabase(database);
if (!uri.endsWith(XmldbURI.ROOT_COLLECTION))
{uri = uri + XmldbURI.ROOT_COLLECTION;}
final Collection root = DatabaseManager.getCollection(uri, user, passwd);
final DatabaseInstanceManager manager = (DatabaseInstanceManager) root
.getService("DatabaseInstanceManager", "1.0");
System.out.println("Shutting down database instance at ");
System.out.println('\t' + uri);
manager.shutdown();
} catch (final XMLDBException e) {
System.err.println("ERROR: " + e.getMessage());
final Throwable t = e.getCause();