Also be careful when disconnecting fuel line on top of sender,it is pressurized and fuel will spray all over you and interior of the car(ask me how I know).You need to release fuel pressure with special tool from fuel rail ,or disconnect fuel pump electrical connector and run engine till it runs out of fuel and stalls(it will throw check engine light and warnings on dash,but it will clear as soon as you plug in connector back when job is done).Fuel pump removal link with pics:
https://www.pelicanparts.com/BMW/tec...eplacement.htm