Turn the String into a byte array and then into an input stream, whichparse does that:builder.parse(new ByteArrayInputStream(text.getBytes()));