code: protected void initBodyElementName(String elementName) {
  
          if ((elementName == null)
              || (m_page.hasValue(elementName, getElementLocale())
                  && !m_page.isEnabled(elementName, getElementLocale()))) {
              // elementName not specified or given element is disabled, determine default element
              List<String> allElements = m_page.getNames(getElementLocale());
              int elementCount = allElements.size();
              List<String> elements = new ArrayList<String>(elementCount);
              for (int i = 0; i < elementCount; i++) {
                  // filter disabled elements
                  if (m_page.isEnabled(allElements.get(i), getElementLocale())) {
                      elements.add(allElements.get(i));
                  }
              }
  
              // get the active page elements
              List<CmsDialogElement> elementList = getElementList();
              for (int i = 0; i < elementList.size(); i++) {
                  CmsDialogElement checkElement = elementList.get(i);
                  if (elements.contains(checkElement.getName())) {
                      // get the first active element from the element list
                      setParamElementname(checkElement.getName());
                      return;
                  }
              }
  
              // no matching active element found
              if (elements.contains(CmsDefaultPageEditor.XML_BODY_ELEMENT)) {
                  // default legacy element present, use it
                  setParamElementname(CmsDefaultPageEditor.XML_BODY_ELEMENT);
              } else {
                  // use the first element from the element list
                  setParamElementname(elements.get(0));
              }
          } else {
              // elementName specified and element is enabled or not present, set to elementName
              setParamElementname(elementName);
          }
      }
docs: Initializes the body element name of the editor.<p>
  
  This has to be called after the element language has been set with setParamBodylanguage().<p>
  
  @param elementName the name of the element to initialize or null, if default element should be used