That's what they're doing to Bowe Bergdahl. And the little turdblossom deserves it.
They're bringing him up on desertion (Article 85 of the UCMJ) and misbehavior before the enemy (Article 99), both fairly serious charges, but the punishment is different. While both are technically punishable by death, Art. 85 is only punishable by death during time of war, whereas Art. 99 is always punishable by death.
Now, IANAL (Any experts on military law please feel free to correct me), but if Bergdahl had done like most other chuckleheads that desert, and done it in CONUS (CONtinental US) he wouldn't be facing the possibility of a death penalty because that only applies during a formal declaration of war (which hasn't happened since WWII). However, because he deserted in a combat zone, and other soldiers had to risk their lives searching for him, he can get charged with Art. 99, and as such, could get the death penalty. It's highly unlikely, and far more probable that he'll just get life - which, I might note, I'm just fine with, unless they find out that Bergdahl is an even bigger shitbucket than he already appears, in which case I'm all in favor of a short drop and a sudden stop.