Over on an agent's blog, she documents how a potential client just shot herself in the foot. The agent had rejected the woman's book but passed it on to another agent, thinking it might be right up their alley (which she didn't tell the potential client). The would-be writer then emailed the agent a nasty note (something the agent says she sees happens all too frequently with email). There went any interest the agency had in representing her.
My thoughts are that you don't respond at all to a form rejection. And if the editor or agent sends you a lot of useful feedback, then you might drop them a thank you. But never, ever, ever be rude and abrasive. Even if you're hurting. Even if you think they are fools to reject you. Even if you can't believe they requested a full and then said nothing more than it wasn't right for them.