Reader reader = new StringReader(str);
InputSource source = new InputSource(reader);
Document.parse(source);