Export to XML

Last updated on Jun 2, 2026

Learn how to save tagged Adobe InDesign content as XML files for use in other applications and workflows.

Export XML to repurpose tagged content while preserving structure. You can export all or part of a document, but only tagged items are included, including tables. Before exporting, create or load tags, apply them to content, and adjust the hierarchy if needed.

Select File > Export.

If you want to export only a portion of the document, select the element in the Structure panel (View > Structure > Show Structure) where you want exporting to begin.

Set a File name and location, and then select XML in Save as type (Windows) or Format (macOS).

Select Save in the Export dialog box.

Select the following options in the General tab of the Export XML dialog box:

 

  • Include DTD Declaration: Exports the DTD reference along with the XML file. This option is only available if there is a DOCTYPE element in the Structure panel.
  • View XML Using: Opens the exported file in a browser, XML editing application, or text editor. Select the browser or application from the list.
  • Export From Selected Element: Starts exporting from the selected element in the Structure panel. This option is only available if you selected an element before selecting File > Export.
  • Export Untagged Tables as CALS XML: Exports untagged tables in CALS XML format. To be exported, the table must be in a tagged frame and must not be tagged.
  • Remap Break, Whitespace, and Special Characters: Exports break, whitespace, and special characters as decimal character entities rather than straight characters.
  • Apply XSLT: Applies a stylesheet to transform exported XML into formats like modified XML or HTML. Select Browse (Windows) or Choose (macOS) to select an XSLT file, or use Use stylesheet from XML to apply the one referenced in the XML.

Select an encoding type from the Encoding menu.

Select one or more of the following options to specify the export options for images in the Images tab:

 

  • Original Images: Places a copy of the original image files in an Images subfolder.
  • Optimized Original Images: Enhances and compresses the original image files and places copies of the files in an Images sub-folder.
  • Optimized Formatted Images: Enhances transformed images, such as rotated or scaled ones, and saves them in an Images subfolder. Only modified images are copied.

Select the options for refining the images if Optimized Original Images or Optimized Formatted Images are selected.

Select Export to create the XML file.

Note

Not all special characters are supported in XML (such as the Automatic Page Number character). InDesign warns you if it cannot include a character in the exported XML file. This warning also appears if you didn’t tag a table.