public Object parse(String s) throws Exception {
  ByteArrayInputStream bin=null;
  String st=stripWhitespaces(s);
  try {
    bin=new ByteArrayInputStream(st.getBytes("UTF-8"));
  }
 catch (  UnsupportedEncodingException ex) {
    throw new Exception("Encoding not supported:" + ex.toString());
  }
  return parse(bin);
}

public Object parse ( String s ) throws Exception { ByteArrayInputStream bin = null ; String st = stripWhitespaces ( s ) ; try { bin = new ByteArrayInputStream ( st . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException ex ) { throw new Exception ( "Encoding not supported:" + ex . toString ( ) ) ; } return parse ( bin ) ; }
parses an xml document from a string variable .
