Hi @burak_Guzeller ,
A 9-axis IMU that I recommend you is LSM9DS1 that combines a 3D digital linear acceleration sensor, a 3D digital angular rate sensor, and a 3D digital magnetic sensor.
Otherwise, if you want to use the LSM6DSR you have two choises:
1) If you haven't done the board and the connections yet, you could connect both DSR and magnetometer to the microcontroller, take data from both, use MotionFX to calculate quaternions.
2) If you have already connected only the LSM6DSR to the micro, you can connect the magnetomer in sensorhub to the LSM6DSR, so that through the LSM6DSR you read both the IMU itself and the mag, at that point in the fw you have the data of both and you can manage them with the MotionFX.