I have that too, and have been working to get rid of it. It can be attributed to a few different things. Searching the forum shows various people saying that bad VANOS, belt tensioners, chain tensioners, low initial oil pressure, etc...have created their start up knocking/rattle.
Mine definitely sounds like it's related to oil presure at start up. Changing to a BMW OE oil filter and proper oil helped mine quite a bit, as mine came from the PO with incorrect (non-syn) oil and aftermarket filter. If you are not using the BMW OE oil filter, try it as the BMW filter helps prevent some of the oil drain back that can occur with other oil filters.
If it sounds like "marbles in a can" then check out this
link for a
discussion from an E39 board where people with the same M62 engines in the 540i are trying to resolve the problem by changing the chain tensioner.
It looks like some of the E39 people had 100% success with the new chain tensioners. I have had 3 BMW's before the X5, but the X is my first M62 engine, so maybe someone with more M62 experience can help.