Nice D40, I had the same issue with my Nav, I tend to turn the lights off before I cross water now. (When I remember.)
It was suggested that I place a fan heater on the bullbar and let it run until the condensation disappeared.
After two attempts with the condensation reappearing both times, I elected to remove the headlight and pull the globe out and let it dry in the sunlight, this worked.
I found the reason for the water entering the headlight in the first place was that a piece of foam that restricts the drain tube in the headlight body was dislodged and water was able to be sucked into the headlight.
Luckliy I have a workshop manual which showed how it should look. I refitted the foam restrictor to the drain tube and have done numerous water crossings since with no issues.