Hello ! I am new to these forums as well as Arduino.
I am doing a project in which I have to measure the Attiude (in Roll,Pitch,Yaw axis) and then transfer that data wirelssly from Arudino(IMU & Xbee connected to it) to Pc(Xbee connected to pc) . So i want to know which IMU should i use, which is easy to use, compatible with arduino mega 2560 R3 and code is also available online.

The term IMU is widely used to refer to a box containing three accelerometers and three gyroscopes and optionally three magnetometers. The accelerometers are placed such that their measuring axes are orthogonal to each other. They measure inertial acceleration, also known as G-forces.[citation needed]

Three gyroscopes are placed in a similar orthogonal pattern, measuring rotational position in reference to an arbitrarily chosen coordinate system.[citation needed]

Recently, more and more manufacturers also include three magnetometers in IMUs. This allows better performance for dynamic orientation calculation in Attitude and heading reference systems which base on IMUs.

Have you read:-

Mike, IMU mentioned is retired from their catalog. They say its replacement is IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345 so would its code be different then ? I was thinking to buy this one .

What about MPU 9150 ? cheaper and probably compatible with XBEE n Arduino.

so would its code be different then

No idea, look at the data sheets of the two devices and see.