Save the output of the query into a clob variable, then add this as the attachment
e.g. something along the lines of:
bulk collect into attach_recs
for 1 in 1 .. attach_recs.count loop
attachment := attachment || attach_recs ( i );
mail_id := apex_mail.send ...
apex_mail.add_attachment ( mail_id, attachment, 'filename' );