Good question! The 2006 BMW X5 battery location is in the middle of the trunk, beneath the spare tire.
To get access to the battery, lift up the carpet panel. Then, remove the spare tire assemblage from the trunk. Now, you can undo the support brackets, disconnect the terminals and vent hose, and lift out the old battery.