code: public boolean checkWelformed(String xml)  {
          boolean result;
          try {
              isWelformed(xml);
              result = true;
          } catch (RuntimeException e) {
              result = false;
          }
          return result;
      }
docs: Checks whether supplied string contains a well formed XML document.
  @param xml xml document
  @return true if xml is well formed.