I've been in your shoes with the key situation. Tried cleaning and all. Bottom line. Time to get a new key. When you do there are excellent directions in the forum on exactly how to program the key. The new key is not cheap.....$200 bucks or so........programming it was the easy part. You will need the old key (the one you have now) and the new key.
http://www.xoutpost.com/articles/x5/e...ob-bmw-x5.html
Good luck!
RR