code: private boolean isValidTemplateElement(String template, String element) {
  
          List elements = new ArrayList(getTemplateElements(template));
          Iterator i = elements.iterator();
          while (i.hasNext()) {
              CmsDialogElement currElement = (CmsDialogElement)i.next();
              if (element.equals(currElement.getName())) {
                  return true;
              }
          }
  
          return false;
      }
docs: Check if the given template includes the specified element.<p>
  
  @param template the template
  @param element the element name
  @return true if the template includes the given element