I think you should do whatever you need to do to feel better about yourself in that situation. If looking hot works, then yes, why not? I wouldn't overdo it, though. You don't want to show up at an attorney's office wearing something more suitable for a night out. That would be inappropriate and, yes, could look desperate. I think you would regret it the moment you walked into the room.
My only other caveat is that you consider your motives. If you have any hope at all that looking hot at the hearing will somehow win him back, you need to let go of that. Could it happen? Yes. Will it? No. He has made his choice and you have to live with it, unfortunately.
If you're just doing it to feel better, go for it. Walk in there looking like a million bucks with your chin held high--even if you have to fake it. I know you are hurting and I'm sorry. What you are feeling right now won't last forever. Hang in there.
Thanks for the question.