public void setMode(int mode) throws ParserConfigurationException,
			TransformerException, IOException, SAXException {
		if (this.mode == GeneralDestruction.MODE_EDITOR && mode == MODE_GAME) {
			this.mode = mode;
			gui.setMode(mode);
			if (currentPath != null) {
				saveTo(currentPath);
				initialize(currentPath);
			}
		} else if (this.mode == GeneralDestruction.MODE_GAME
				&& mode == MODE_EDITOR) {
			this.mode = mode;
			gui.setMode(mode);
			if (currentPath != null) {
				initialize(currentPath);
			}
		}
	}