One thing WHG touched on that I want to expand on is that thru the process, remember that your kids are watching you.
Thru my own sitch, I've tried to demonstrate to my kids that vows are important, marriage is worth fighting for, people can change, family is first, etc. Once I got this in my head, a lot of the decision making became easier and I can honestly say, whether my M makes it or not, I've done a pretty decent job in teaching my kids these things.
Thinking of it this way can give you that extra ounce of patience you sometimes need, the ability to walk away and cool down, the willingness to meet your S in the middle.
This is a great perspective, and I absolutely agree with it. Where I tend to differ from some other "play nice" folks is that I also agree it's important for me to model for my children that sometimes you have to fight for what's right, and you have to stand up for yourself. Also, as a Christian, there was the whole issue of "how long will I condone unholiness (everyone's mutual knowledge of my wife's continued, unrepentant affair) in my marriage and in our family's home?"
Not very easy stuff, I know. Personally, I wanted to convey to my children -- especially my adult daughters -- that while I did not WANT to divorce their mother, and I was going to fight very hard to keep our family intact, that it was more important to me to "do the right thing" and maintain my own self-respect and dignity and Christian faith.