public void appendTo(XMLElement parent) {
		XMLElement et = parent.add("Testcase");
		et.setValue("title", title);
		et.setValue("currentNumber", "" + currentNumber);
		et.setValue("runNumber", "" + runNumber);
		et.setValue("size", "" + size);
		et.setValue("scriptname", scriptname);
		et.setValue("classification", classification);
		if (starttime != null) et.setValue("starttime", starttime);
		if (endtime != null) et.setValue("endtime", endtime);
		
		XMLElement var0 = et.add("vars");
		for (Map.Entry<String, String> ev : vars.entrySet()) {
			XMLElement var = var0.add("var");
			var.setValue("name", ev.getKey());
			var.setText(ev.getValue());
		}

		XMLElement ez0 = et.add("script");
		if (script != null) {
			for (String z : script.replace("\r", "").split("\n")) {
				XMLElement ez = ez0.add("line");
				if (z.startsWith("\t\t")) {
					ez.setValue("tab", "2");
					z = z.substring(2);
				} else if (z.startsWith("\t")) {
					ez.setValue("tab", "1");
					z = z.substring(1);
				} else {
					ez.setValue("tab", "0");
				}
				ez.setText(z);
			}
		}
		
		XMLElement p = et.add("actions");
		for (TbAction action : actions) {
			action.appendTo(p);
		}
	}