There's a dirty way to create XLS files - you write the data you want in the Excel file as an HTML page with <table> tags etc, but you set the content type to the Excel content type.

Another way is to simply write your CSV or TSV out, with the Excel content type. The Content Type you want is application/vnd.ms-excel.