I have a 2L TDI and that developed a bad rattle, even for a diesel. It came from the inlet. With the bonnet up just behind the grill on the left side, there is a plastic box bolted to the front cross member with a 60mm diameter plastic pipe linking this to the airbox. The air pipe had worn enough to be no longer a tight fit. Hence it vibrated and rattled very loudly. I have only done 65000 kms. I cured it with a piece of self adhesive foam packing. Time to find noise: on and off for about two weeks. Time to effect the cure 20 minutes.
Incidentally if the noise is coming from the pipes under the floor try using silicon sealer as an alternative to plastic foam (mentioned in an earlier post). Clean any dirt and grease off both surfaces, poke the nozel between them and squirt out a button of silicone. Press the pipe into silicon and let it settle where it wants to. If necessary you can push the silicon in place with a licky-spit finger. When dry, (give it 24 hours) the gap is gone and the pipe is secure without any tension being applied. I have used this method on several cars where wiring looms or hoses touch each other or the body. It is surprising how quiet you can make an engine bay.