There are lots of threads, with a variety of instructions. Some of them conflict with each other. There are also 5, 6, and 8 speed ZF transmissions, and 5 and 6 speed GM transmissions, depending on year of X5.
If you have a 2011 35d (as your profile indicates...but you should put it in your signature line so we don't have to search) then the fill procedure is in the BMW service manual. There isn't a procedure for changing the fluid contained in the manual, for a variety of assumed reasons.
Here is my short procedure. Basic mechanic skills assumed. All at your own risk:
1) Drain the fluid. Have the car up in the air, but level. That means a hoist or jack stands, not jacks.
2) Remove the transmission pan, clean it, and replace the filter. Use only a ZF filter from ZF or BMW, not an aftermarket filter.
3) Replace the pan according to the BMW instructions, service manual page attached.
4) Top up the fluid according to the BMW instructions, service manual page attached. Use a temperature probe to ensure that the fluid is around 30 C when you close it up. The ZF manual publishes a range, the BMW instructions assume you are using their service tooling.
5) See the torque specs in the attachments.
6) Use only ZF Lifeguard 6 fluid, available from a variety of suppliers and licensees. Do not use fluids that say "suitable for use in...." but rather fluids that say "this is the real thing" or words to that effect. There are enough issues with these transmissions that using a multipurpose fluid just seems like an increased risk for no benefit, IMO. If you don't want to buy it from ZF, there are approved fluids that are fine. There are also many fluids that are not approved, but which claim to be fine. I'd trust ZF, myself.
I would get parts from CTSC, here:
The CTSC - ZF Parts, or use your own local ZF distributor. The dealer is not an option.
Others can add to this with variations, but this at least gets us to a BMW instruction as a starting point.
Jeff