public static Document toDOMDocument(String xmlString,Debug debug){
  if ((xmlString == null) || (xmlString.length() == 0)) {
    return null;
  }
  try {
    ByteArrayInputStream is=new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
    return toDOMDocument(is,debug);
  }
 catch (  UnsupportedEncodingException uee) {
    if (debug != null && debug.warningEnabled()) {
      debug.warning("Can't parse the XML document:\n" + xmlString,uee);
    }
    return null;
  }
}

public static Document toDOMDocument ( String xmlString , Debug debug ) { if ( ( xmlString == null ) || ( xmlString . length ( ) == 0 ) ) { return null ; } try { ByteArrayInputStream is = new ByteArrayInputStream ( xmlString . getBytes ( "UTF-8" ) ) ; return toDOMDocument ( is , debug ) ; } catch ( UnsupportedEncodingException uee ) { if ( debug != null && debug . warningEnabled ( ) ) { debug . warning ( "Can't parse the XML document:\n" + xmlString , uee ) ; } return null ; } }
converts the xml document from a string format to dom document format .
