It is an area of great confusion, and different people think about it in different ways. roll/pitch/yaw only make sense when you think about a rigid body in space. XYZ convention makes sense when the axes on the body have Z forward, X up and Y to the right, which is a common frame for a robot end effector (the convention for vehicles is different). The first thing you do is point the body in the right direction in the horizontal plane, that's the yaw motion and the rotation is about the X axis. So the first thing we do is rotate about X by the yaw angle. Next we pitch the body, lift the nose up or down, that's a rotation about the Y axis by the pitch angle. Finally, we rotate about the body axis, the X axis, by the roll angle.