Trying to finish a paper with a professor, but also needing to let them know I switched advisors
Having been in a similar situation before, I can say this: Prof. X may not want to finish a paper with you if you're changing advisors, and Prof. Z may not want you to continue spending time on unrelated research.  Does Prof. Z even know of your intentions?  You should make sure Z actually wants to be your advisor first.  Does Prof. X know you've already been working with Z?  He will probably feel betrayed, and there's nothing you can do to avoid that.  You will have to have in-person conversations with both professors, maybe even both at the same time, if the two are on friendly terms.  (If they aren't on friendly terms, then things will get more complicated, and you may need a mediator.)

In any case, I would not explain the situation via e-mail, but I would e-mail to schedule an appointment and say that you need to discuss something important.  This will allow Prof. X to mentally prepare and also ensure that everyone has set aside time to focus on the issue.  I would spend some time writing out what you want to say, maybe even bring the notes with you, but also anticipate that you may need to have multiple conversations.  If Prof. X is notoriously belligerent, see if you can arrange for a mediator to be present.  Finally, try to think of what you really want out the interaction-- working on a project with someone you've just told you don't want to work with can be quite miserable for both parties, and it may be better to cut your losses and move on.