NodeData rootData = ((NodeData)((NodeImpl)sysSession.getRootNode()).getData());
TransactionableDataManager dataManager = sysSession.getTransientNodesManager().getTransactManager();
cleanWorkspace(dataManager);
StreamImporter importer =
new ExportImportFactory().getWorkspaceImporter(rootData, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW,
dataManager, dataManager, sysSession.getWorkspace().getNodeTypesHolder(),
sysSession.getLocationFactory(), sysSession.getValueFactory(), getNamespaceRegistry(),
sysSession.getAccessManager(), sysSession.getUserState(), context, this, wsName);
importer.importStream(xmlStream);
}
finally
{
sysSession.logout();
}