code: protected static String getSubstitutedTemplateContent(String templateContent, NamesValuesList<String, String> namesValues) {
          String templateContentSubst = templateContent;
          // substitute the name/values
  
          for (NameValue<String, String> nameValue : namesValues) {
              templateContentSubst = templateContentSubst.replace(nameValue.name, nameValue.value);
          }
          return templateContentSubst;
      }
docs: Substitutes names by values in template and return result.
  
  @param templateContent content of the template to substitute
  @param namesValues list of names/values to substitute
  @return result of substitution