code: public static String readElement(Element rootElement, String elementName) throws DocumentException
      {
          String result = null;
          Element element = rootElement.element(elementName);
          if (element != null) {
              // Make sure the element does not have any child element
              if (!element.isTextOnly()) {
                  throw new DocumentException("Unexpected non-text content found in element [" + elementName + "]");
              }
  
              result = element.getText();
          }
          return result;
      }
docs: Read an element from the XML.
  
  @param rootElement the root XML element under which to find the element
  @param elementName the name of the element to read
  @return null or the element value as a String
  @throws DocumentException if it is not a valid XML wiki page
  @since 10.8RC1