I agree that betrayal and rejection are very very hard to come to terms with. How can we not feel worthless when the person we most loved rejects us?
We tell ourselves it isn't us, but feeling it is another matter. That takes time. Actually there is great dignity in raising our kids as a single parent, and we gradually become someone that we can be proud of. We have to create our own reality, instead of a shared one, in which someone we loved is reflecting good things about us, back to us. that is really powerful. It isn't co-dependence, but affirmation.
Self affirming is harder. You will get there - I am sure of that, but it will be hard at times. The bad patches become less, and the good ones longer and longer, but to be honest, even now, I miss my xh and marriage, as it was.