');
[your code, using htp.print() instead of dbms_output.put_line()]
htp.print('
');
Then just look on the "HTP output" tab. Right-click, "View source" will let you save to file. Or if you really want to spool, add some code that reads the htp buffer using OWA.get_line()/OWA.get_page() and uses UTL_FILE to write to a file.