Tools.injectAnnotations(e, this); Element port = new Element("port"); Tools.injectAnnotations(port, ip); Element port = new Element("port"); Tools.injectAnnotations(port, op); port.setAttribute("name", op.getName()); port.setAttribute("depth", op.getDepth() + ""); containerElement.addContent(activityElement); Tools.injectAnnotations(containerElement, saci); activitesElement.addContent(containerElement);