I solved the engine rattle in my '02 220. Go back to the 1st page on this forum and choose the top thread "Important Poll ...." there is a discussion about this on the link shown at the bottom of the second post. I have heard two distinct rattles coming from my bike - one in the cylinder and one in the clutch. I've heard the same noises in KX's and in KTM's. If you think a KDX is loud, the KTM's are twice as loud straight off the showroom floor (clutch noise). The top end rattle in my bike is caused by carbon build-up on the main "flapper" valve. I can hear it from low to mid rpm. When I cleaned this part, the noise stopped. When I corrected the jetting on the bike and swithched to Mobil 1 synthetic pre-mix (40:1), the noise didn't return until after 400 miles but it wasn't as bad. When the bike was brand new (jetted rich) I ran Yamalube with the stock jetting. Yamalube is a great oil but with the stock jetting my main valve was caked with carbon, and the noise was terrible. I can only speak on my experiences with this bike. The noise you're hearing could be for another reason. Clean the valves really good, and take it from there.
The clutch noise is easy to distinguish. At idle, pull in the clutch lever. If the noise changes tone, you'll know it's a typical KDX. Try putting in a full quart of 10W-30.