 <p>The following works for me:</p> <pre><code> try (InputStream stream = Test.class.getResourceAsStream("/Test.xml")) { StreamSource source = new StreamSource(stream); final XML xml = new XMLDocument(source); } </code></pre> <p>With the input file's hex dump:</p> <pre><code>FF FE 3C 00 3F 00 78 00 6D 00 6C 00 20 00 76 00 65 00 72 00 73 00 69 00 6F 00 6E 00 3D 00 27 00 31 00 2E 00 30 00 27 00 20 00 65 00 6E 00 63 00 6F 00 64 00 69 00 6E 00 67 00 3D 00 27 00 55 00 54 00 46 00 2D 00 31 00 36 00 27 00 3F 00 3E 00 3C 00 58 00 20 00 69 00 64 00 3D 00 22 00 31 00 22 00 2F 00 3E 00 </code></pre> <p>As far as I can tell, in your example you are converting the contents of the file to a string. But this is problematic because you actually throw away the encoding when you convert bytes to string. When the SAX parser converts the string to a byte array, it decides it will be UTF-8, but the prolog states that it is UTF-16 and so you have a problem.</p> <p>Instead, when I use the StreamSource, it just automatically detects the fact that the file is encoded in UTF-16 LE from the BOM.</p> <p>If you are not using java-7 or up and cannot use try-with-resources, then use the stream.close() as before.</p>