How to politely explain editor is wrong
I think you just lay out the facts as you see them, pointing to supporting evidence as necessary. If the editor can't be convinced then how you say things isn't going to matter much. Let the facts speak for themselves. Point up the flaws in X as applied to your work. And if you need to reference textbooks, do so, even citing page numbers. 

You may lose the battle, but it may not be winnable at this journal. If the reviewer is wrong, but is someone trusted by the editor you have a losing situation. If you sense that then withdraw politely and go to another journal.