When parsing XML files with new lines at the end for file, it throws exception "Unexpected data in the end of document". in StringSource.js in canRead(n), there should not be +1 in the expression.