I have finally got the replacement of water pump and thermostat done over 2 weekends: the first weekend was to remove the water pump and thermostat following the guide by IT_Texan on this thread. Once the components were off the vehicle I ordered the right parts. The second weekend was to reinstall the replacement parts.
The thermostat has one port that has elbow outlet and many online auto parts stores sell the same thermostat with straight outlet. I finally found a matching thermostat on Amarzon, and here is the link:
https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
and water pump
https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
which looks exactly the same as the one off vehicle.
The X5 has been happy running for 2 weeks now. Thank you all for the help.