public synchronized void exportXML(java.io.Writer writer)
			throws java.io.IOException {
		if (!opened) {
			throw new StorageError(StorageError.STORAGE_NOT_OPENED);
		}

		objectCache.flush();

		int rootOid = header.root[1 - currIndex].rootObject;

		if (rootOid != 0) {
			XMLExporter xmlExporter = new XMLExporter(this, writer);
			xmlExporter.exportDatabase(rootOid);
		}
	}