# .xml file output for .mhd file

**URL:** <https://discourse.slicer.org/t/xml-file-output-for-mhd-file/38100>\
**Category:** Support\
**Created:** [August 28, 2024, 8:42pm UTC](https://discourse.slicer.org/t/xml-file-output-for-mhd-file/38100 "2024-08-28T20:42:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QianyuXie\_Julie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qianyuxie_julie/32/77767_2.png) [@QianyuXie\_Julie](https://discourse.slicer.org/u/QianyuXie_Julie)\
**Post date:** [August 28, 2024, 8:42pm UTC](https://discourse.slicer.org/t/xml-file-output-for-mhd-file/38100/1 "2024-08-28T20:42:47Z")

</div>

Hi everyone,

I’m working on a Unity project and I need a related `.mhd` file along with an `.xml` file. However, when I export the `.mhd` image from Slicer3D, I only get the `.mhd` and `.raw` files.

Does anyone know how I can generate the `.xml` file that I need? Should this file be generated from the `.raw` file, or is there another way to create it from the data exported by Slicer3D?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 28, 2024, 8:49pm UTC](https://discourse.slicer.org/t/xml-file-output-for-mhd-file/38100/2 "2024-08-28T20:49:27Z")

</div>

An image is stored in a single .mha file; or in an .mhd and a .raw file.

There should be no need for any .xml file, because all metadata, including any custom metadata can be stored in the .mha or .mhd file itself. Maybe you worked with NIFTI file format before, which is so limited that it requries an xml sidecar to store custom metadata.

---

<div class="post-metadata">

**Author:** ![QianyuXie\_Julie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qianyuxie_julie/32/77767_2.png) [@QianyuXie\_Julie](https://discourse.slicer.org/u/QianyuXie_Julie)\
**Post date:** [August 29, 2024, 9:04pm UTC](https://discourse.slicer.org/t/xml-file-output-for-mhd-file/38100/3 "2024-08-29T21:04:06Z")

</div>

Thank you for your response! I actually managed to solve the issue—I found the .xml file I needed, and it turns out it’s a configuration file specific to my project. Your explanation about the .mhd and .mha files was really helpful, though, and I appreciate you taking the time to clarify that!
