encoding errors when writing out XML removing executable bit refactor tests to handle sanity checking