Diesel systems are 'self-bleeding' and air in the system will be removed from the fuel system by normal use. There is another check before replacing the pump, and that is to ensure that e fuel pump relay is OK. The relay is above the glovebox and is the one nearest the firewall.
Relay in position 1 in the attached. As it's only $14 US, it's worth a try.
RealOEM.com * BMW E53 X5 3.0d Relay positioning, behind glove box
Mine went three months ago and the pump would not run.