To create a XPI file for firefox is very simple, you can read article 2 Steps to create XPI File for Firefox to get more detail informaiton.
However, if you want to know more detail, you can read this article, here i will give you a example.
Step 1: You should have a firefox extension source code
Before you plan to create a xpi file, you should have to have some source code for firefox extension, these source may like this:
Step 2: Use zip application you have installed on computer to zip these file
As above, you can zip .js, .json, .rdf file to a zip file.
Step 3: Rename zip file to xpi file
You can rename your created zip file into a xpi file, like showed above, it is called a Short URL Submit.xpi,then you can install and use it in firefox.
Google+