You don't want to come across to a judge as being on a witch hunt and using your daughter as a means to punish your wife for her immoral behavior. The judge will see right through it.
A judge always rules "in the best interests of the child". And a child needs both parents.
Your main objective from here on out is to be as calm as possible. Do not react, at all. Even when she starts throwing outrageous allegations at you. Calm. Calm is your friend.