I think the whole ladder discussion is a bit out there, but I always assumed the ladder folded away into the hull. It would seem silly for a ladder not to be designed into the x-wing, since the cockpit is so high off the ground . It'd probably have a few more (and smaller) segments than the image below, but it's good enough for illustrative purposes.