If the change of rein calls for a posting trot with a lengthening of stride, you do not change the diagonal at X. In this case, when you are only posting for the length of the diagonal line across the arena and you haven't been posting around the preceding corner, it doesn't matter which diagonal you are on--although most advanced riders cross the arena on the diagonal that would be appropriate for the upcoming corner, simply because it helps them begin to bend the horse as they approach the corner.
If, however, the test does not call for a lengthening of stride, but simply asks you to change rein across the diagonal, then you change your diagonal at X. In this case, you approach X on the diagonal appropriate for the corner you have just completed, then change to the diagonal appropriate for the upcoming corner.