To all those who declare that there is never a reason to turn off a transponder in flight.
I have turned of my transponder in a civil transport type in flight.
It had stopped working and I happened to have both an engineer on board and a spare box on board.
We asked ATC if we could take up a PPOS hold rather than land back on. We turned it off, swapped it out and turned it back on.
Now this is an unlikely situation in a civvy airliner, but if there is one reason to do it, there are likely many more.