public static MatchingQuestion getMatchingQuestionByXMLElem(XMLElement root, Quiz quiz, int pos) {
		int quizID = quiz.quizID;
		int position = pos;
		Object question = null;
		Object answer = null;
		double score = 10;
		ArrayList<String> questionList = new ArrayList<String>();
		ArrayList<String> answerList = new ArrayList<String>();
		ArrayList<Integer> answerIndex = new ArrayList<Integer>();
		for (int i = 0; i < root.childList.size(); i++) {
			XMLElement elem = root.childList.get(i);
			if (elem.name.equals("query")) {
				questionList.add(elem.content);
			} else if (elem.name.equals("query-list")) {
				for (int j = 0; j < elem.childList.size(); j++) {
					XMLElement subElem = elem.childList.get(j);
					if (!subElem.name.equals("query")) 
						System.out.println("Question list unexpected name " + subElem.name);
					if (!subElem.attributeMap.containsKey("answer")) 
						System.out.println("Matching question must have attribute 'answer' for each query");
					int ans = Integer.parseInt(subElem.attributeMap.get("answer"));
					answerIndex.add(new Integer(ans));
					questionList.add(subElem.content);
				}
			} else if (elem.name.equals("answer-list")) {
				questionList.addAll(Question.getAnswerListByXMLElem(elem));
			} else if (elem.name.equals("score")) {
				score = Double.parseDouble(elem.content);
			} else {
				System.out.println("Unexpected field in matching question : " + elem.name);
			}
		}
		int N = questionList.size() / 2;
		for (int i = 0; i < answerIndex.size(); i++)
			answerList.add(questionList.get(N + answerIndex.get(i).intValue()));
		question = questionList;
		answer = answerList;
		return new MatchingQuestion(quizID, position, question, answer, score);		
	}