Our expansion tank on our E60 M5 developed a small crack so I replaced it. Here are the rough steps. I did skip and made the ending simple. You need to add the proper level of coolant as well as bleed the air from the system. What I did was to put my air conditioning max hot temp, open the cap until about 5-10 mins when I can see water is flowing and some steam going out of the tank opening before I put the cap back.
Expansion tank part number is 17112283345