z coordinate of empty object won't export when exporting the object to directx
You may simply need to apply your transformations.  You can look at your viewport shelf by hitting your N key to see if this needs to be done. See below for images regarding both.

To check and see if you need to apply any transformations, you can select the object in blender and then hit the N key to open/close the shelf.  It should look like this across the board:



If any of the numbers in these fields are different from the numbers in the image above, transformations have not been applied.

You can apply all of your transformations (Scale changes, rotation changes, etc) by having the object selected in Blender and hitting CTRL+A to open the Apply menu and clicking "All Transformations".



Alternatively, if it is simply a translation problem between Blender and DirectX, this may fix the problem.  During your export process

If these simple solutions aren't the answer for you, it may be something you need to adjust for when you export, but the options you have in the export process differ depending on the file type and I'm not familiar with the .X format or what sort of options you have for it specifically.