Document doc = docBuilder.newDocument();
Element xTests = doc.createElement("tests");
doc.appendChild(xTests);
Tests exec = new Tests();
long totalTime = 0;
float avgTime = 0;
int totalTests = 0;
int passedTests = 0;
int failedTests = 0;
for (LinkedList<String> test : tests) {
// copy list contents to arguments' array
String[] testArgs = new String[ test.size() ];
for(int i = 0; i < test.size(); ++i) testArgs[i] = test.get(i);
// run test
Tests.TestResult r = exec.executeCommand(testArgs);
totalTime += r.time;
totalTests += 1;
if (r.ok) passedTests += 1; else failedTests += 1;
// add test result to xml tree