--- title: "XML Minifier activity" slug: "bc-xml-minifier-activity" description: "Optimize your XML documents with the XML Minifier in Business Integration Solutions, removing non-mandatory nodes while preserving mandatory ones." tags: ["BC", "BIS", "Business Central", "Business Integration Solutions", "Concept", "Task"] updated: 2026-06-25T11:58:45Z published: 2026-06-25T11:58:45Z canonical: "docs.staedean.com/bc-xml-minifier-activity" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # XML Minifier activity In Business Integration Solutions, use the **XML Minifier** activity to clean an XML document of empty nodes and blocks that are not mandatory. ## Set up the XML Minifier ![](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/BIS_XMLMinifierSetup(1).png) | Field | Description | | --- | --- | | Document Type | Specifies whether the linked document is **External** or **Internal**. | | Document No. | Specifies the linked document. | ## Examples ### Example: Single-level document This example uses a simple internal document based on the SalespersonPurchaser table. It contains two mandatory fields: **GlobalDimension1Code** and **NextTaskDate**. ![](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/BIS_XmlMinifierDoc1Setup(1).png) The following connection retrieves test data for the **XML Minifier**: [Timer event](/business-central/docs/bc-set-up-a-timer-event) > [XML Generator](/business-central/docs/bc-setup-xml-generator-activity) > [Mapper](/business-central/docs/bc-mapper-activity) - **Timer Event:** exports a set of records from D365 BC. - **XML Generator:** maps the set of records to a readable XML structure. - **Mapper:** creates a mapped document to process with the **XML Minifier**. In this example, the same document is the source and target, with 1:1 mapping. The XML document sent to the **XML Minifier** has the following structure. The mandatory node **GlobalDimension1Code** is empty, and the non-mandatory nodes **GlobalDimension2Code** and **PhoneNo** are empty as well. ```plaintext    HR    Helena Ray    0    false            HR@contoso.com        2024-01-20    11 ``` The XML document from the **XML Minifier** has the following structure. The empty mandatory node **GlobalDimension1Code** remains in the structure, while the non-mandatory nodes **GlobalDimension2Code** and **PhoneNo** are removed. ```plaintext    HR    Helena Ray    0    false        HR@contoso.com    2024-01-20    11 ``` ### Example: Multi-level document This example uses a multi-level internal document based on the SalesHeader, SalesLine, and Item tables. The mandatory nodes are **SalesHeader/YourReference** and **Item**. ![Document2Setup](Images/BIS_XmlMinifierDoc2Setup.png) Using the same connection setup as example 1 but with the multi-level document, and with no node mapped inside the **Item** block, the document from the **Mapper** has the following structure. ```plaintext    30000    101005              10000      2      1920-S      ANTWERP Conference Table                                                       ``` The XML document from the **XML Minifier** has the following structure. The empty mandatory nodes **SalesHeader/YourReference** and **Item** remain in the structure, while the non-mandatory node **JobNo** and the nodes inside **Item** are removed. ```plaintext    30000    101005              10000      2      1920-S      ANTWERP Conference Table           ``` ## Related - [Setting up activities](/bc-setting-up-activities.md) - [Set up a Timer event](/bc-set-up-a-timer-event.md) - [Setup XMLGENERATOR activity](/bc-setup-xml-generator-activity.md) - [Set up the Mapper activity](/bc-set-up-the-mapper-activity.md)