I found this tutorial to be really helpful in understanding how to go about creating an extension for Firefox and Thunderbird:
http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/
It takes a little bit of the magic out of .XPIs.