writer.write(" </sources>\n");
writer.write(" <packages>\n");
writer.write(" <package name=\"all\" line-rate=\"" + data.getLineRate() + "\" branch-rate=\"" + data.getBranchRate() + "\" complexity=\"0.0\">\n");
writer.write(" <classes>\n");
for(String fileName : data.getFileNames()) {
FileCoverage fc = data.getFileCoverageFor(fileName);
writer.write(" <class name=\""+fileName+"\" filename=\""+fileName+"\" line-rate=\""+fc.getLineRate()+"\" branch-rate=\""+fc.getBranchRate()+"\" complexity=\"0.0\">\n");
writer.write(" <methods>\n");
writer.write(" </methods>\n");
writer.write(" <lines>\n");
for(int line : fc.getLines()) {
LineCoverage lc = fc.getLineCoverageFor(line);
Collection<BranchCoverage> bcs = fc.getBranchCoverageFor(line);
if(bcs == null) {
writer.write(" <line number=\"" + line + "\" hits=\"" + lc.getHits() + "\" branch=\"false\"/>\n");
} else {
String coverageString = calculateCoverage(bcs);
writer.write(" <line number=\"" + line + "\" hits=\"" + lc.getHits() + "\" branch=\"true\" condition-coverage=\"" + coverageString + "\">\n");