I'm not divorced (still happily married thankfully), but my parents divorced when I was 5 (about the same age as your kids) so my story might have some value.
My mother did the same thing to my father that
@Robocok 's ex did to him. She told everyone that he hit her. Combine that lie with the truth that he had a criminal record with assault charges and it was easy for my mom to steamroll him in court. She wound up with sole custody and my time with my dad became very irregular entirely dependent on her whims.
I was completely devastated by the divorce for a few years. At some point along the way (maybe around 8 years old) I asked why they split up for the millionth time. She told me that he hit her. I harbored a lot of resentment for him for a few years after that.
Over time I saw that my dad is an honest person with a profound sense of honor, even if he is a bit of an asshole. I also saw that my mom is a habitual liar and manipulator. When I was around 11 or 12 I finally got the courage to ask my dad why he hit my mom. He said that he didn't. When I got home from that visit I confronted her about it. She admitted that she lied. For at least five years after that I hated her so intensely that I can't even describe it.
I began constantly asking to move in with my dad and being an all-around terrible child in her house until she finally let me go live with my dad when I was 14.
I have two younger sisters who share both my parents. Today, I'm very close to my dad and see my mom every couple months. I am civil and bring over her grandkids, but I still don't like her or trust her. My sisters are both much closer to my mom than I am, but they both know she is a shitty person and they both see my dad all of the time.
The biggest advice I can give you is to make sure that your kids always know you love them and to try to see them as much as you can. If you consistently are there for them and are generally a good person, they will see it. If you cancel visits or aren't making an effort, they will see it. They will also see the truth about your spouse over time.
Sorry for the long-winded post. Divorce is just a really big deal to me.
Good luck and don't give up.