Added file encoding check for XML input streams