glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
else:
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
However, that will react to a "seeThrough" attribute on your node, but not to the "xray joint" option from the maya menu directly. I guess you can probably query the status of xRay joint from within your node, but never had to do this. I'd be curious to know how to do it tho