Prepare for It. This one is easy. All you have to do is smile and say "Thank you so much for your support. I've enjoyed my time here and I've learned a lot from you. Let me know what I can do to make the transition easier." Are you always going to get reaction number five? Probably not. But if you look for the signs, you can likely anticipate your boss' response, go into the conversation prepared, and come out stronger on the other side. Then, you can breathe a sign of relief and start looking forward to starting your new position.
After that, you're ready to close out your letter and move on. The basic closings are fine here__again, you don't need to go overly sentimental or formal, but you should also write as if it will be read by anyone at the company. And with that signing flourish, you're done! You've resigned, and you're ready for your exciting new job.