Sometimes the most important part of a letter of resignation is what you don't include.
As previously mentioned, the best way to form a resignation letter is to be positive, polite and brief. Sometimes there is no way to frame your reasons for leaving the company in a positive light. Sometimes there are complaints that need to be voiced. For the most part, however, the resignation letter itself is not the place to air dirty laundry, reveal too much, or address complicated questions.
Complaints are the main component that ought to be left out of a resignation letter. Complaints that are delivered in writing might as well be set in stone. They can be used against you if legal situations arise, and they look like petty diatribes in writing because there is no possibility of communication or dialogue. However, sometimes you are leaving a job due to harassment or unsatisfactory working conditions. If you feel the need to include that, be brief and objective. "I am unable to continue working in the present environment" is often as much as you need to say. Grievances should be enumerated and elaborated upon during the exit interview if necessary.
Questions about severance pay, vacation time and sick days can be briefly mentioned in a resignation letter, but don't go into detail. It won't get sorted out just from your letter, even if you tell them the days you saved up and how much you're owed. It's best to discuss additional payments and benefits in person with H/R or management, since you don't know what you'll be offered or how things will be pro-rated. If you do bring the subject up, mention specifically that you look forward to discussing the matter before your last day. That is the only way you can be assured that the issue will be acknowledged and addressed. Don't just mention it in your letter and expect it to show up on your final paycheck.
When it comes to leaving for a competitor, should you include that tidbit in your resignation letter or leave it out? Most people are mixed on the subject. It is very likely that if you tell your boss that you're leaving for a competing company you will be escorted from the premises immediately. However, if the field and the companies are small, your boss is going to find out anyway, and may then feel betrayed and angry. If you know that your boss will discover where you are going eventually then it is best to be upfront about it (and to make sure you haven't signed a non-compete clause first!) If you think your boss will never know, leave it out. There's no need to rub it in that you got a better offer or that you're working for your boss' arch nemesis. That way leads only to burnt bridges and possibly legal ramifications to boot.