If you and your ex have young children, my empathetic heart goes out to you, I have a few too. Getting divorced is one thing, having to draw them into the morass of your divorce is quite another, however, if you have residence issues to resolve, you will have to.
There are two issues here: (a) practical ones covering technicalities like where they are going to sleep on which nights and therefore who is going to have the majority of parental responsibility in the eyes of the authorities and (b) emotional ones, like how you cope with their self imposed guilt for you splitting up, their sadness for missing parent A when they stay with parent B and many more, all of which are very common.
Every child is an individual, with personal needs and sadnesses. All you can do is your very best to listen to them, respect them and work towards alleviating or eliminating them. Do so with a willing heart but accept the fact that you may overcome some of the emotional battles, but you’re unlikely to win the war.
Give them love in abundant quantities through whatever mesh of difficulties or miles you have to and accept that may be all you can do.