private boolean addBranches(Document doc, Element lineElement, List<BranchData> branchDatas) {
        lineElement.setAttribute("branch", "true");
        Element conditionsElement = doc.createElement("conditions");
        lineElement.appendChild(conditionsElement);
        int branches = 0;
        int branchHits = 0;
        for (int j = 1; j < branchDatas.size(); j++) {
            Element conditionElement = doc.createElement("condition");
            conditionsElement.appendChild(conditionElement);
            conditionElement.setAttribute("number", "" + j);
            conditionElement.setAttribute("type", "jump");
            BranchData branchData = branchDatas.get(j);
            conditionElement.setAttribute("coverage", format("%d%%", branchData.getCoverage()));
            branches += 2;
            if (branchData.getEvalFalse() > 0)
                branchHits++;
            if (branchData.getEvalTrue() > 0)
                branchHits++;
        }
        lineElement.setAttribute("condition-coverage", format("%d%% (%d/%d)", Math.round(branchHits*100d/branches), branchHits, branches));
        return branchHits > 0;
    }