2011 X5
I never really knew much about the battery in the fob or what it might mean if it died. Three weeks ago, I was left using only the emergency key inside the fob. Putting the fob in the slot for a couple of long trips did nothing. Dead Dead Dead.
All the horror stories about $350 replacements and DYI dremel-assisted dismantling and resoldering sounded like to much cost or trouble so I just let it go.
Yesterday, we took the X5 in for a free 99 point inspection (part of a local dealer celebration) and they found a couple of warranty items. Good for us.
While we were there I happened to ask what a new fob/key might cost because my fob battery died and wouldn't recharge.
The helpful fellow took my key, popped open the secret hatch,
and popped in a new CR-2032 battery and all was right in the world once again. 
So, before you break open your key, check and see if the battery is simply accessible and replaceable. I never would have seen the battery compartment cover... and it's not mentioned in the manual. 