You haven't said what the problem is that you are getting

However InputSources expect to work with Streams rather than Readers so I would change your bold portion to read:
fin = new FileInputStream(filename);
xr.parse(new InputSource(fin));
and of course change the definition of fin to be a FileInputStream