In my experience, it is perhaps better for your health to forget about exporting animations to .x, because the exporter will not support the fantastic tools blender has.
If you do not construct the armature correctly, it will crash.
If you parent the armature incorrectly, it will crash.
If you use some IK features, it will crash.
If you do not export with a 3D window open, it will crash.
If you use any modifiers, it will crash.
If you do everything correctly, the planets are aligned and your soul is pure, it may still crash anyway.
It might be better to try with the B3D exporter.(proper standard)
or rig in fragmotion/milkshape.
Secretly competent too...