code: @Override
      public ITemplate getTemplateFromTemplateXML(eu.atos.sla.parser.data.wsag.Template templateXML,    String payload) throws ModelConversionException{
          ITemplate template = new Template();
          if (templateXML.getTemplateId() != null) {
              logger.debug("TemplateId at header will be used:{}", templateXML.getTemplateId());
              template.setUuid(templateXML.getTemplateId());
          } else {
              // uuid
              if (templateXML.getContext().getTemplateId() != null) {
                  logger.debug("TemplateId in context will be used:{}", templateXML.getTemplateId());
                  template.setUuid(templateXML.getContext().getTemplateId());
              }else{
                  String templateId = UUID.randomUUID().toString();
                  template.setUuid(templateId);
              }
          }
          
          if (templateXML.getContext().getService()!=null){
              template.setServiceId(templateXML.getContext().getService());
          }else{
              logger.error("Service is null, field must be informed");            
              throw new ModelConversionException("Service is null, field must be informed");
          }
          
          // Text
          template.setText(payload);
          // Name
          template.setName(templateXML.getName());
          template.setProvider(getProviderFromTemplate(templateXML));
          return template;
      }
docs: /* (non-Javadoc)
  @see eu.atos.sla.util.IModelConversion#getTemplateFromTemplateXML(eu.atos.sla.datamodel.parser.xml.agreement.Template, java.lang.String)