private Element getEdgesElement(ArrayList<Arc> listOfArcs, Document doc) {
        Element edges = doc.createElement("edges");

        for (Arc a : listOfArcs) {
            Element edge = doc.createElement("edge");

            String type = "";
            String resourceType = "";

            Attr edgeType = doc.createAttribute("type");


            Attr X1 = doc.createAttribute("x1");
            Attr Y1 = doc.createAttribute("y1");
            Attr X2 = doc.createAttribute("x2");
            Attr Y2 = doc.createAttribute("y2");

            if (a.getOutElement() instanceof Transition) {
                type = "TP";
                if (a.getInElement() instanceof Resource) {
                    resourceType = "P_" + a.getInElement().getName();
                    insertProf("P_" + a.getInElement().getName());
                }
                if (cobaFile) {
                    //X1.setValue(tranform(a.getInElement().getX()) + "");
                    //Y1.setValue(tranform(a.getInElement().getY()) + "");
                    //X2.setValue(tranform(a.getOutElement().getX()) + "");
                    //Y2.setValue(tranform(a.getOutElement().getY()) + "");
                    Point tempPoint = setCoBAPoint(a.getInElement().getX(), a.getInElement().getY());
                    X1.setValue(tempPoint.x + "");
                    Y1.setValue(tempPoint.y + "");
                    tempPoint = setCoBAPoint(a.getOutElement().getX(), a.getOutElement().getY());
                    X2.setValue(tempPoint.x + "");
                    Y2.setValue(tempPoint.y + "");
                } else {
                    X1.setValue(a.getInElement().getX() + "");
                    Y1.setValue(a.getInElement().getY() + "");
                    X2.setValue(a.getOutElement().getX() + "");
                    Y2.setValue(a.getOutElement().getY() + "");
                }

            } else {
                type = "PT";
                if (a.getOutElement() instanceof Resource) {
                    resourceType = "P_" + a.getOutElement().getName();
                }
                if (cobaFile) {
                    /*
                     X1.setValue(tranform(a.getOutElement().getX()) + "");
                     Y1.setValue(tranform(a.getOutElement().getY()) + "");
                     X2.setValue(tranform(a.getInElement().getX()) + "");
                     Y2.setValue(tranform(a.getInElement().getY()) + "");
                     */
                    Point tempPoint = setCoBAPoint(a.getOutElement().getX(), a.getOutElement().getY());
                    X1.setValue(tempPoint.x + "");
                    Y1.setValue(tempPoint.y + "");
                    tempPoint = setCoBAPoint(a.getInElement().getX(), a.getInElement().getY());
                    X2.setValue(tempPoint.x + "");
                    Y2.setValue(tempPoint.y + "");
                } else {
                    X1.setValue(a.getOutElement().getX() + "");
                    Y1.setValue(a.getOutElement().getY() + "");
                    X2.setValue(a.getInElement().getX() + "");
                    Y2.setValue(a.getInElement().getY() + "");
                }

            }
            edgeType.setValue(type);
            edge.setAttributeNode(edgeType);
            edge.setAttributeNode(X1);
            edge.setAttributeNode(Y1);
            edge.setAttributeNode(X2);
            edge.setAttributeNode(Y2);

            Attr power = doc.createAttribute("power");
            //?????????????
            power.setValue(a.getCapacity() + "");
            edge.setAttributeNode(power);

            Attr resourceProfession = doc.createAttribute("ResourceProfession");
            //?????????????
            resourceProfession.setValue(resourceType);
            edge.setAttributeNode(resourceProfession);


            Attr red1 = doc.createAttribute("red1");
            red1.setValue(a.getColor().getRed() + "");
            edge.setAttributeNode(red1);

            Attr green1 = doc.createAttribute("green1");
            green1.setValue(a.getColor().getGreen() + "");
            edge.setAttributeNode(green1);

            Attr blue1 = doc.createAttribute("blue1");
            blue1.setValue(a.getColor().getBlue() + "");
            edge.setAttributeNode(blue1);

            Attr green2 = doc.createAttribute("green2");
            green2.setValue(a.getColor2().getGreen() + "");
            edge.setAttributeNode(green2);

            Attr red2 = doc.createAttribute("red2");
            red2.setValue(a.getColor2().getRed() + "");
            edge.setAttributeNode(red2);

            Attr blue2 = doc.createAttribute("blue2");
            blue2.setValue(a.getColor2().getBlue() + "");
            edge.setAttributeNode(blue2);

            Attr fontSize = doc.createAttribute("fontSize");
            fontSize.setValue(a.getFontSize() + "");
            edge.setAttributeNode(fontSize);

            for (Point p : a.getBendPoints()) {
                Element bendPoint = doc.createElement("bendPoint");
                Attr x = doc.createAttribute("x");
                Attr y = doc.createAttribute("y");
                if (cobaFile) {
                    //x.setValue(tranform(p.x) + "");
                    //y.setValue(tranform(p.y) + "");
                    Point tempPoint = setCoBAPoint(p.x, p.y);
                    x.setValue(tempPoint.x + "");
                    y.setValue(tempPoint.y + "");
                } else {
                    x.setValue(p.x + "");
                    y.setValue(p.y + "");
                }

                bendPoint.setAttributeNode(x);
                bendPoint.setAttributeNode(y);
                edge.appendChild(bendPoint);
            }

            edges.appendChild(edge);
        }
        return edges;
    }