private void addBranchElement(Document doc, Element linesElement, FileData fileData, int i, Element lineElement) {
        if (fileData.getBranchData().keySet().contains(i)) {
            List<BranchData> branchDatas = fileData.getBranchData().get(i);
            if (lineElement == null) {
                lineElement = doc.createElement("line");
                linesElement.appendChild(lineElement);
                lineElement.setAttribute("number", "" + i);
            }
            boolean wasHit = addBranches(doc, lineElement, branchDatas);
            lineElement.setAttribute("hits", wasHit ? "1" : "0");
        }
    }