So sorry to hear about the situation. Have you read Divorce Busting or Divorce Remedy yet? Very helpful and the changes you make from that info will help you stay sane no matter which way the marriage goes. I'm sure you both have done things that lead the marriage to where it is now. What is your wife's complaints about the marriage that lead her to wanting a divorce? (If she stopped having EAs and stayed with you another 5 years, it sounds like deep down she loves you but there is some serious problems between you two.) Did you read the Languages of Love book to figure out what her Love Language is and if you have been communicating to her that you love her in the way that makes sense to her?

Just some ideas to look into. I'm a newbie too so I'm sure some more experienced will stop by to ask more questions.