public void Format(StatLightResult result) { XElement xml = new XElement("test-results", new XAttribute("name", result.Name), new XAttribute("total", result.TotalTests), new XAttribute("not-run", result.TotalIgnored), new XAttribute("failures", result.TotalFailed), new XAttribute("date", result.DateRun.ToString("yyyy-MM-dd")), new XAttribute("time", result.DateRun.ToString("HH:mm:ss")), new XElement("test-suite", new XAttribute("type", "TestFixture"), new XAttribute("name", Path.GetFileName(result.Name)), new XAttribute("executed", "True"), new XAttribute("result", result.TotalFailed > 0 ? "Failure" : "Success"), new XAttribute("success", result.TotalFailed > 0 ? "False" : "True"), new XElement("results", from r in result.Tests select CreateTestCaseElement(r)) ) ); xml.Save(writer); }