public String printXMLResults(boolean all) {
		StringBuffer sb = new StringBuffer(100);
		double singleMultiRatio = 0.0;

		sb.append("<?xml version=\"1.0\"?>");
		sb.append("<bsbm>\n");
		sb.append("  <querymix>\n");
		sb.append("     <scalefactor>" + parameterPool.getScalefactor()
				+ "</scalefactor>\n");
		sb.append("     <warmups>" + warmups + "</warmups>\n");
		if (multithreading)
			sb.append("     <nrthreads>" + nrThreads + "</nrthreads>\n");
		sb.append("     <seed>" + seed + "</seed>\n");
		sb.append("     <querymixruns>" + queryMix.getQueryMixRuns()
				+ "</querymixruns>\n");
		sb.append("     <minquerymixruntime>"
				+ String.format(Locale.US, "%.4f", queryMix
						.getMinQueryMixRuntime()) + "</minquerymixruntime>\n");
		sb.append("     <maxquerymixruntime>"
				+ String.format(Locale.US, "%.4f", queryMix
						.getMaxQueryMixRuntime()) + "</maxquerymixruntime>\n");
		if (multithreading) {
			sb.append("     <totalruntime>"
					+ String.format(Locale.US, "%.3f", queryMix
							.getTotalRuntime()) + "</totalruntime>\n");
			sb.append("     <actualtotalruntime>"
					+ String.format(Locale.US, "%.3f", queryMix
							.getMultiThreadRuntime())
					+ "</actualtotalruntime>\n");
			singleMultiRatio = queryMix.getTotalRuntime()
					/ queryMix.getMultiThreadRuntime();
		} else {
			sb.append("     <totalruntime>"
					+ String.format(Locale.US, "%.3f", queryMix
							.getTotalRuntime()) + "</totalruntime>\n");
			singleMultiRatio = 1;
		}

		if (multithreading)
			sb.append("     <qmph>"
					+ String.format(Locale.US, "%.2f", queryMix
							.getMultiThreadQmpH()) + "</qmph>\n");
		else
			sb.append("     <qmph>"
					+ String.format(Locale.US, "%.2f", queryMix.getQmph())
					+ "</qmph>\n");
		sb.append("     <cqet>"
				+ String.format(Locale.US, "%.5f", queryMix.getCQET())
				+ "</cqet>\n");
		sb.append("     <cqetg>"
				+ String.format(Locale.US, "%.5f", queryMix
						.getQueryMixGeometricMean()) + "</cqetg>\n");
		sb.append("  </querymix>\n");

		if (all) {
			sb.append("  <queries>\n");
			// Print per query statistics
			Query[] queries = queryMix.getQueries();
			double[] qmin = queryMix.getQmin();
			double[] qmax = queryMix.getQmax();
			double[] qavga = queryMix.getAqet();
			double[] avgResults = queryMix.getAvgResults();
			double[] qavgg = queryMix.getGeoMean();
			int[] qTimeout = queryMix.getTimeoutsPerQuery();
			int[] minResults = queryMix.getMinResults();
			int[] maxResults = queryMix.getMaxResults();
			int[] nrq = queryMix.getRunsPerQuery();
			for (int i = 0; i < qmin.length; i++) {
				if (queries[i] != null) {
					sb.append("    <query nr=\"" + (i + 1) + "\">\n");
					sb.append("      <executecount>" + nrq[i]
							+ "</executecount>\n");
					sb.append("      <aqet>"
							+ String.format(Locale.US, "%.6f", qavga[i])
							+ "</aqet>\n");
					sb.append("      <aqetg>"
							+ String.format(Locale.US, "%.6f", qavgg[i])
							+ "</aqetg>\n");
					sb.append("      <qps>"
							+ String.format(Locale.US, "%.2f", singleMultiRatio
									/ qavga[i]) + "</qps>\n");
					sb.append("      <minqet>"
							+ String.format(Locale.US, "%.8f", qmin[i])
							+ "</minqet>\n");
					sb.append("      <maxqet>"
							+ String.format(Locale.US, "%.8f", qmax[i])
							+ "</maxqet>\n");
					sb.append("      <avgresults>"
							+ String.format(Locale.US, "%.2f", avgResults[i])
							+ "</avgresults>\n");
					sb.append("      <minresults>" + minResults[i]
							+ "</minresults>\n");
					sb.append("      <maxresults>" + maxResults[i]
							+ "</maxresults>\n");
					sb.append("      <timeoutcount>" + qTimeout[i]
							+ "</timeoutcount>\n");
					sb.append("    </query>\n");
				} else {
					sb.append("    <query nr=\"" + (i + 1) + "\">\n");
					sb.append("      <executecount>0</executecount>\n");
					sb.append("      <aqet>0.0</aqet>\n");
					sb.append("    </query>\n");
				}
			}
			sb.append("  </queries>\n");
		}
		sb.append("</bsbm>\n");
		return sb.toString();
	}