final Collection collection = client.current;
final Resource resource = collection.createResource(resName, resType);
resource.setContent(resourceContent.toString());
((EXistResource)resource).setMimeType(resourceType.getMimeType());
collection.storeResource(resource);
collection.close();
client.reloadCollection();
} catch(final XMLDBException xmldbe) {
ClientFrame.showErrorMessage(xmldbe.getMessage(), xmldbe);
}