public List<String> handleWorkingSets(XMLMemento xmlMemento, Shell shell) {
List<String> workingSetNames = new ArrayList<String>();
// try working sets
IMemento[] sets = xmlMemento.getChildren("workingSets"); //$NON-NLS-1$
IWorkingSetManager wsManager = TeamUIPlugin.getPlugin().getWorkbench()
.getWorkingSetManager();
WorkingSetStatus status = new WorkingSetStatus();
for (int i = 0; i < sets.length; i++) {
IWorkingSet newWs = wsManager.createWorkingSet(sets[i]);
if (newWs != null) {
workingSetNames.add(newWs.getName());
IWorkingSet oldWs = wsManager.getWorkingSet(newWs.getName());
if (oldWs == null) {
wsManager.addWorkingSet(newWs);
} else if (status.isReplaceAll()) {
getWorkingSetHelper().replaceWorkingSet(wsManager, newWs,
oldWs);
} else if (status.isMergeAll()) {
getWorkingSetHelper().mergeWorkingSets(newWs, oldWs);