X4 Help Center

Merge

symbol_merge_32.png

Merge: Merges XML documents from different sources into a single XML document or merges text or binary streams.

Properties

Label

Label of the icon in the process diagram

Root Element

Name of the root element that contains the entire content of the merged XML documents.

Possible values:

  • String that is valid for XML element names.
    Standard: Merge


Merging data with Merge

The merge component is usually used after merging a fork (Join). When XML documents are merged, the XML document created by the Merge componsnt contains a root element, which in turn contains the root elements and all nodes of the merged XML documents. This XML structure can be processed by the next process step. The name of the root element can be specified via the Root Element property of the merge component.

Note:

When a Merge component merges XML documents with at least one non-XML document, the output of all documents is concatenated in the output generated by the Merge component.

When merging two XML documents that have already been merged by the Merge component in a previous step, the result XML document contains only one root element and all the nodes of the merged XML documents.

Merging two documents
XML
<?xml version="1.0" encoding="UTF-8" ?>
<Merge>
   <!-- Daten 1 -->
   <!-- Daten 2 -->
</Merge>

If the input documents are text data (MIME type text ... or application/xml) with the same character encoding, their character encoding is returned. If the character encoding is different, a UTF-8 sequence is returned. If the MIME type is the same for all input documents, then the result also has this MIME type, otherwise text/plain.

Configuring the root element

The merge component combines multiple XML fragments into a result document. The configured root element name controls how the merged content is structured in the output.

Default behavior: Flat list with root element <Merge>

If you want to create a flat list without additional nesting, use the default value <Merge> as the root element name.

Example output:

XML
<Merge>
  <Order id="ORD-2026-00123" status="OPEN">
    <Customer id="C-10001"/>
    <Total currency="EUR">149.90</Total>
  </Order>
  <Order id="ORD-2026-00124" status="OPEN">
    <Customer id="C-10002"/>
    <Total currency="EUR">89.50</Total>
  </Order>
</Merge>

All merged elements are inserted directly below the root element <Merge>.

Individual root element name: Nested structure

If you need more structured output, use a unique name for the root element (for example, CustomerOrders). This allows the result to contain additional levels to logically group content (for example, current versus archived orders).

Example output:

XML
<CustomerOrders customerId="C-10001">
  <Order id="ORD-2026-00123" status="OPEN">
    <Total currency="EUR">149.90</Total>
  </Order>
  <archivedOrders>
    <Order id="ORD-2025-00987" status="CLOSED">
      <Total currency="EUR">219.00</Total>
    </Order>
  </archivedOrders>
</CustomerOrders>

This allows you to map additional layers in the results structure and integrate the merged content into an existing XML structure.