private Element createGraphic(AbstractFigure figure) {
        Element graphics = dom.createElement("graphics");

        if (figure instanceof AbstractArcFigure) {
            AbstractArcFigure arcFigure = (AbstractArcFigure) figure;
            Iterator it = arcFigure.getPoints().iterator();
            while (it.hasNext()) {
                PathPoint pathPoint = (PathPoint) it.next();
                Element position = dom.createElement("position");
                position.setAttribute("x", "" + (int) pathPoint.getPosition().getX());
                position.setAttribute("y", "" + (int) pathPoint.getPosition().getY());
                graphics.appendChild(position);
            }
        } else {
            Element position = dom.createElement("position");
            Point2D p = figure.getPosition();
            position.setAttribute("x", "" + (int) p.getX());
            position.setAttribute("y", "" + (int) p.getY());
            graphics.appendChild(position);
        }

        return graphics;
    }