public boolean add(Debate debate) {
		// Get root element
		Element debateE = document.getRootElement();
		// Adding user elements and attribute 'username'
		Element debateElement = debateE.addElement("debate").addAttribute(
				"id", debate.getId());
		// Add child elements
		debateElement.addElement("id").setText(debate.getId());
		debateElement.addElement("topic").setText(debate.getTopic());
		debateElement.addElement("description").setText(debate.getDescription());
		debateElement.addElement("maxTurns").setText(debate.getMaxTurns()+"");
		debateElement.addElement("turnDuration").setText(debate.getTurnDuration()+"");
		debateElement.addElement("maxTime").setText(debate.getMaxTime());
		debateElement.addElement("timeLeft").setText(debate.getTimeLeft());
		debateElement.addElement("materials").setText(debate.getMaterials());
		debateElement.addElement("status").setText(debate.getStatus());
		debateElement.addElement("isDelete").setText(debate.getIsDelete() + "");
		debateElement.addElement("teamALeader").setText(debate.getTeamLeader()[0]);
		debateElement.addElement("teamBLeader").setText(debate.getTeamLeader()[1]);
		debateElement.addElement("currentTurnTeam").setText("A");
		debateElement.addElement("acceptPositionTeam").setText("A");
		if (debate.getTeamRep() == null) {
			debateElement.addElement("teamARep").setText("null");
			debateElement.addElement("teamBRep").setText("null");
		} else {
			debateElement.addElement("teamARep").setText(debate.getTeamRep()[0]);
			debateElement.addElement("teamBRep").setText(debate.getTeamRep()[1]);
		}
		
		String[][] teams = debate.getTeam();
		if (teams.length != 0) {
			String teamA = "", teamB = "";
			for (int i = 0; i < teams[0].length; i++) {
				teamA += teams[0][i] + ",";
				teamB += teams[1][i] + ",";
			}
			debateElement.addElement("memberA").setText(teamA);
			debateElement.addElement("memberB").setText(teamB);
		}
		debateElement.addElement("winner").setText(debate.getWinner() + "");
		
		// Write to xml
		try {
			XmlUtils.write2Xml(fileName, document);
		} catch (IOException e) {
			e.printStackTrace();
		}
		// Create Chat.xml, PrivateDialog.xml, PublicDialog.xml
		XmlUtils xmlUtils = new XmlUtils();
		String foldPath = "src//xml//Debate" + debate.getId();
		File f=new File(foldPath + "//a.txt");
		System.out.println(f.getPath());
		f.getParentFile().mkdirs();
		
		xmlUtils.createPublicXMLFile(foldPath + "//PublicDialog.xml");
		xmlUtils.createPrivateXMLFile(foldPath + "//PrivateDialogA.xml");
		xmlUtils.createPrivateXMLFile(foldPath + "//PrivateDialogB.xml");
		return true;
	}