I am following a guide, and it gives me the following code:
InputSource inputSource = new InputSource(new FileInputStream(new File(\"/path/to/xml/file.xml\"))));
Use a StringReader instead of a FileInputStream.
StringReader
FileInputStream
See the documentation for StringReader
example:
InputSource inputSource = new InputSource( new StringReader( myString ) );