using $mocha-phantomjs -R xunit -f outputFile.xml myPage.html
----> this is generating a console output in xml format but not writing in the output file.
On the other hand :
$mocha-phantomjs -R json -f outputFile.json myPage.html
-----> this is working as expected.