To update OnePlus X to Android Marshmallow, it should be running on the latest OxygenOS 2.2.3. OnePlus recently rolled out the 2.2.3 update for the device, which includes prerequisites for Android Marshmallow update. If you have not updated to OxygenOS 2.2.3, just update your OnePlus X to the version (guide here) and then check for the OxygenOS 3.1.2 (Marshmallow) OTA update by going to Settings > About Phone.
Below are the main highlights of OxygenOS 3.1.2 update for OnePlus X Experienced users can manually update their OnePlus X to OxygenOS 3.1.2, folks over at OnePlus forum has managed to capture the update and made available for download. To update manually, download OxygenOS 3.1.2 OTA Zip file [HERE] [Source] and save it on your phone’s internal memory. Boot your OnePlus X into stock recovery by pressing and holding Volume Up and Power buttons together. Select ‘Apply update’, browse for the zip file that you saved in step 1, select it and confirm installation. Once done reboot your phone. (Source – OnePlus Forum)