The only way you'r going to get a factory fit is if you use a factory system. There's more info
here, and a tutorial for a non-nav E39 conversion
here. I also recently purchase an extremely well-maintained '97 540i, and I've been tossing around the idea of adding nav as well. However, after reading the tutorial, I don't think I'd need it enough to justify the cost and hassle. I've got a pretty good sense of direction. I will look for it on my next car, though