If you want the output to be a binary (non editable) file stored in a proprietary format, please use Oracle's export utility.
If you want the output to be a plain text file that you can open in any editor, don't use Oracle's export. Oracle 10g has a metadata package. In older releases, you need a set of custom code to do the job. See Oracle Technology Network (http://technet.oracle.com). Such code is also found on various Oracle user forums that allow pinning of sample code.
First part, exports the entire database to the full.dmp file without rows; statistics=NONE will avoid warnings of "questionable statistics", plus it avoids having to export more than necessary.
Second part, using import, simply shows (show=Y) what would execute if you to really imported the full.dmp file. The log=db.log will capture everything that is about to fly by on the screen. From this log file, you will have extra information displayed, but all of the objects will be there, plus the "CREATE" script used to create the object. Be aware, this will also output procedures/functions/packages -- and since most of the Oracle packages are "wrapped", when they print out, you will see what looks like streams of hexidecimal code. This is completely normal.