Auto detect binary or xml format

...and change file extensions