Dear Mr./Ms. Bossname,
Here's the letter you requested for putting my resignation in writing. I appreciate how receptive you are to my future career. I would not be in such a great position to move forward if not for your mentorship and expertise.
It is my hope that we can keep my resignation confidential at this time. Please hold off on a press release, companywide announcement, and so on. I've been advised that I will have more leverage in my job search if it appears at first glance that I am still employed. (Of course, I will disclose my status when I secure interviews.)
I will miss working with our team, and specifically your leadership. I hope my next role includes a boss like you.