code: private static String getElementContent(Element element, String defaultStr)
      {
          if (element == null)
          {
              return defaultStr;
          }
  
          NodeList children = element.getChildNodes();
          StringBuilder result = new StringBuilder("");
          for (int i = 0; i < children.getLength(); i++)
          {
              if (children.item(i).getNodeType() == Node.TEXT_NODE
                      || children.item(i).getNodeType() == Node.CDATA_SECTION_NODE)
              {
                  result.append(children.item(i).getNodeValue());
              }
          }
          return result.toString().trim();
      }
docs: Get the content of the given element.
  
  @param element
  The element to get the content for.
  @param defaultStr
  The default to return when there is no content.
  @return The content of the element or the default.
  @throws Exception
  the exception