private void saveConnections(){
		HashSet<String> roomSet = new HashSet<String>();
		ExitDirection dir = null;
		String rooms = "";
		String connections = "";
		String xml = "<?xml version=\"1.0\"?>\n<game name=\"";
		xml = xml + name.getText()+"\">\n<description>\n\"";
		xml = xml + desc.getText()+"\"\n</description>\n";
		xml = xml + "<rooms>\n";
		for(int i=0; i<buildPanel.getComponentCount(); i++){
			if(i%3==0){
				JTextField room1 = (JTextField)buildPanel.getComponent(i);
				connections = connections + "<connect>\n<room1 name=\""+room1.getText()+"\">\n";
				roomSet.add(room1.getText());
			}else if(i%3==1){
				JComboBox<String> direc = (JComboBox<String>)buildPanel.getComponent(i);
				String direction = direc.getSelectedItem().toString();
				dir = ExitDirection.parse(direction);
				connections = connections + "<exit type=\""+dir+"\">\n";
				connections = connections + "</exit>\n</room1>\n";
			}else{
				ExitDirection dirRe = null;
				switch(dir){
				case north:
					dirRe = ExitDirection.south;
					break;
				case south:
					dirRe = ExitDirection.north;
					break;
				case east:
					dirRe = ExitDirection.west;
					break;
				case west:
					dirRe = ExitDirection.east;
					break;
				}
				JTextField room2 = (JTextField)buildPanel.getComponent(i);
				connections = connections + "<room2 name=\""+room2.getText()+"\">\n";
				connections = connections + "<exit type=\""+dirRe.toString()+"\">\n";
				connections = connections + "</exit>\n</room2>\n</connect>\n";
				roomSet.add(room2.getText());
			}
		}
		for (String s:roomSet){
			rooms = rooms + "<room>res/game/"+s+".xml</room>\n";
		}
		xml = xml + rooms;
		xml = xml + "</rooms>\n<connections>\n";
		xml = xml + connections;
		xml = xml + "</connections>\n";
		
		xml = xml + "<players>\n<player sprite=\"res/SingleGeorge.png\" startRoom=\"Outside\">\n<health>20</health>\n<attack>1</attack>\n<defence>1</defence>\n<xloc>75</xloc>\n<yloc>150</yloc>\n</player>\n</players>\n";
		
		xml = xml + "</game>\n";
		BufferedWriter out;
		try{
			out = new BufferedWriter(new FileWriter("res/game/Game.xml"));
			out.write(xml);
			out.close();
		}catch (IOException e){
			return;
		}
	}