Need help preparing a 'Sitemap.xml' file using a Rake

After having my websites up for a few months and wondering why my
content is not exposed through search engines, I discovered SITEMAPS!
I've done a Google for explanations of how this is accomplished and
found these links;

http://www.igvita.com/2006/11/24/google-yahoo-sitemaps-in-rails/
http://scoop.cheerfactory.co.uk/2008/02/26/google-sitemap-generator/
http://harrylove.org/2008/06/10/google-sitemaps-with-ruby-on-rails-capistrano-and-cron#comment-245
http://tonycode.com/wiki/index.php?title=Ruby_on_Rails_Sitemap_Generator

These are either not current Rails 2.? explanations or are too
esoteric for me to follow.

I've written the logic to travel through my database and build the
various links but I don't know how to;

1. Write this into a Rake task
2. deliver the output to a xml file
3. format the xml file to behave the way Google wants

My plan is to download the data files from my website onto my desktop
computer. Run the Rake procedure and then simply upload the
sitemap_??.xml files.
Hopefully, someone could teach me how to build the index file to
compliment these.

I'm 'between a rock and a hard place' on this one and am willing to
pay someone for guidance.
Thanks,
Kathleen
KathysKode@gmail.com