My question involves child support in the State of: PA

Does the domestic relations office decide who claims the kids for income tax purposes? Is it automatically the CP? When my ex and I split, we agreed that each of us would claim one child for tax purposes. The first year I claimed 1, she claimed 1. The 2nd year I went to file, and she had filed before I did, and she claimed both of them. I called her up and she told me that her lawyer said she has the right to claim both of them and there was nothing I could do about it. She has been claiming them both for the last 3 years. I am the NCP, but I am the one who pays the child support which I pay the taxes on, and she collect the child support and she does not have to claim that as income. I don't think that is fair. We both pay to support the kids, so why should she be able to get the tax deductions for them when I am the one paying more in taxes? How do I go about being able to claim one of my children? I want it to be fair. She claims one, I claim one. She will never agree to let me claim either one. Any advice is appreciated.