E-Commerce, Magento 2
<!–
–>

When working with suppliers, you may often encounter XML files with custom table structures and formatting. Magento 2 cannot always process these files out of the box, especially when product attributes use different names or follow a structure that doesn’t match Magento’s requirements.
The same challenge can occur when exporting data. Your CRM, ERP, supplier, or other business software may require XML files to follow a specific structure and formatting standard.
That’s why we introduced XSLT support in the Improved Import & Export extension. It lets you transform XML files and adapt their structure to the format required by Magento 2 or your external systems, making it easier to exchange product and other data with virtually any integration.

Table of contents
- About Magento 2 XSLT Support in Improved Import & Export
- What is XSLT
- How Can I Use XSLT in Magento 2 Import and Export in 2026
- How to Compose XSLT Template for Magento 2 Open Source and Adobe Commerce
- Final Words: Import Any XML to Magento 2 with XSLT in 2026
- FAQ About Magento 2 XSLT for Import and Export
About Magento 2 XSLT Support in Improved Import & Export
Improved Import and Export extension for Magento 2 allows you to import data into your Magento 2 store using XML files. However, the extension cannot support all possible formats of the XML files. That’s why we have come up with the following acceptable XML format:
- XML 1.0
- encoding: UTF-8
- field separator: space
- first row: column names
- top-level root name: Items
- XML record name: item
The Improved Import and Export extension added the ability to accept XML tables in any format using the XSLT editor. The editor is available inside the jobs you create; it is job-specific, meaning you can create a dedicated XSLT template for each task.

For Magento 2 import, the XSLT editor can be used to interpret custom-formatted XML files. Making such files Improved Import and Export compatible. For Magento 2 export, XSLT editor can be used to define the format of the output XML file. This can be particularly useful if you intend to use it somewhere else.
Buy Improved Import Magento 2 Extension
What is XSLT
XSLT stands for Extensible Stylesheet Language Transformations. As the name suggests, it is a language for transforming XML documents. XSLT is used to transform one XML document into another, and not necessarily XML.
XSLT belongs to the XSL(T) family of languages.
- XSLT is used to transform XML documents.
- XPath is used in XML document navigation.
- XQuery is used for querying XML documents.
It all started with XSL – an XML stylesheet language. You can think of it as a CSS for HTML. However, XML doesn’t use predefined tags to identify its entities, so each tag can mean a different object or subject. Here where XSL comes in; it defines how each XML element should be displayed.
XSLT is the most important part of XSL. It tells the XML document how to form entries, how to name them, which punctuation to use, and what the document should look like in the end.
You can think of XSLT as a script for forming end XML document. The translation is done in a single step, which can be roughly illustrated as:

As you can see from the illustration above, you only need a raw XML document and an XSLT template. When the raw XML undergoes the XSLT translation, you get a new XML document.
In the transformation process, XSLT defines which parts of the raw document should match one or more conditions/templates. When such a match is found, XSLT transforms it into the new document.
If you require more information on XSLT, please visit:
- XSLT Introduction
- XSL(T) Languages
There, at w3schools.com, you will find all necessary information about XSLT.
So, what XSLT can do for you:
- Add/remove elements to or from the document;
- Rearrange and sort elements;
- Perform tests;
- Decide which elements to display;
XSLT can do much more for your new XML document, and the choice is really up to you and the developer you are working with.
How Can I Use XSLT in Magento 2 Import and Export in 2026
To understand how you can take advantage of the XSLT editor in Magento 2 import and export processes, you should first identify your workflow.
Import use case for XSLT in Magento 2
You are working with a supplier that sends you catalog updates in XML, and you probably can’t import this XML right away. XML formatting differs significantly, and the Improved Import and Export extension cannot cover every case.
Now, with the XSLT editor, you can import the XML file that your supplier sends you. Just write or ask your developer to write proper XSLT translation, paste it into the XSLT editor, and run the job. The extension will interpret the XML for you.
For example, a file from Criteo has the following formatting:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
<?xml version=“1.0” encoding=“UTF-8”?>
<rss xmlns:g=“http://base.google.com/ns/1.0” version=“2.0”>
<channel>
<title>Your Website</title>
<link>http://www.yoursite.com/us/</link>
<description>Your Website</description>
<item>
<g:id>myproductid</g:id>
<g:title>Working Boots Size 7.5</g:title>
<g:description>Excellent for daily use</g:description>
<g:google_product_category>Women’s > Shoes > Working Boots</g:google_product_category>
<g:link>http://www.example.com/product/working-boots</g:link>
<g:image_link>
http://www.shotsmedia.nl/xml_images/TT96602_1.jpg
</g:image_link>
<g:additional_image_link>
http://www.shotsmedia.nl/xml_images/50007_1.jpg
</g:additional_image_link>
<g:additional_image_link>
http://www.shotsmedia.nl/xml_images/SHT016-3_1.jpg
</g:additional_image_link>
<g:availability>in stock</g:availability>
<g:price>1299.99 EUR</g:price>
<g:sale_price>1199.99</g:sale_price>
<g:gtin>0001234560012</g:gtin>
<g:brand>Criteo</g:brand>
<g:adult>TRUE</g:adult>
<g:product_type>Women’s > Shoes > Working Boots</g:product_type>
<g:mobile_link>http://m.example.com/product/working-boots</g:mobile_link>
<g:condition>new</g:condition>
<g:availability>in stock</g:availability>
<g:availability_date>2016-06-25T13:00-0800</g:availability_date>
<g:sale_price_effective_date>2016-03-01T13:00-0800/2016-03-11T15:30-0800</g:sale_price_effective_date>
<g:item_group_id>abc123</g:item_group_id>
<g:color>Black</g:color>
<g:gender>male</g:gender>
<g:age_group>adult</g:age_group>
<g:material>leather</g:material>
<g:pattern>Striped</g:pattern>
<g:size>L</g:size>
<g:size_type>regular</g:size_type>
<g:size_system>US</g:size_system>
<g:shipping>…</g:shipping>
<g:shipping_weight>1 kg</g:shipping_weight>
<g:shipping_label>promotion</g:shipping_label>
<g:multipack>2</g:multipack>
<g:is_bundle>FALSE</g:is_bundle>
<g:custom_label_0>custom data 0</g:custom_label_0>
<g:custom_label_1>custom data 1</g:custom_label_1>
<g:custom_label_2>custom data 2</g:custom_label_2>
<g:custom_label_3>custom data 3</g:custom_label_3>
<g:custom_label_4>custom data 4</g:custom_label_4>
<g:sale_price_effective_date>2016-03-01T13:00-0800/2016-03-11T15:30-0800</g:sale_price_effective_date>
<g:adwords_redirect>http://www.mywebsite.com/productpage.html</g:adwords_redirect>
<g:excluded_destination>Shopping</g:excluded_destination>
<g:expiration_date>2016-07-24</g:expiration_date>
<g:unit_pricing_measure>15oz</g:unit_pricing_measure>
<g:unit_pricing_base_measure>50oz</g:unit_pricing_base_measure>
</item>
<item>
<g:id>1H3</g:id>
<g:title>Working Boots Size 7.7</g:title>
<g:description>Excellent for daily use</g:description>
<g:google_product_category>Women’s > Shoes > Working Boots</g:google_product_category>
<g:link>http://www.example.com/product/working-boots22</g:link>
<g:image_link>
http://www.shotsmedia.nl/xml_images/SHT016-2_1.jpg
</g:image_link>
<g:additional_image_link>
http://www.shotsmedia.nl/xml_images/SHT016-1_1.jpg
</g:additional_image_link>
<g:additional_image_link>
http://www.shotsmedia.nl/xml_images/50063_1.jpg
</g:additional_image_link>
<g:availability>in stock</g:availability>
<g:price>130 EUR</g:price>
<g:sale_price>1199.99</g:sale_price>
<g:gtin>0001234560012</g:gtin>
<g:brand>Criteo</g:brand>
<g:adult>TRUE</g:adult>
<g:product_type>Women’s > Shoes > Working Boots</g:product_type>
<g:mobile_link>http://m.example.com/product/working-boots</g:mobile_link>
<g:condition>new</g:condition>
<g:availability>in stock</g:availability>
<g:availability_date>2016-06-25T13:00-0800</g:availability_date>
<g:sale_price_effective_date>2016-03-01T13:00-0800/2016-03-11T15:30-0800</g:sale_price_effective_date>
<g:item_group_id>abc123</g:item_group_id>
<g:color>Black</g:color>
<g:gender>male</g:gender>
<g:age_group>adult</g:age_group>
<g:material>leather</g:material>
<g:pattern>Striped</g:pattern>
<g:size>L</g:size>
<g:size_type>regular</g:size_type>
<g:size_system>US</g:size_system>
<g:shipping>…</g:shipping>
<g:shipping_weight>1 kg</g:shipping_weight>
<g:shipping_label>promotion</g:shipping_label>
<g:multipack>2</g:multipack>
<g:is_bundle>FALSE</g:is_bundle>
<g:custom_label_0>custom data 0</g:custom_label_0>
<g:custom_label_1>custom data 1</g:custom_label_1>
<g:custom_label_2>custom data 2</g:custom_label_2>
<g:custom_label_3>custom data 3</g:custom_label_3>
<g:custom_label_4>custom data 4</g:custom_label_4>
<g:sale_price_effective_date>2016-03-01T13:00-0800/2016-03-11T15:30-0800</g:sale_price_effective_date>
<g:adwords_redirect>http://www.mywebsite.com/productpage.html</g:adwords_redirect>
<g:excluded_destination>Shopping</g:excluded_destination>
<g:expiration_date>2016-07-24</g:expiration_date>
<g:unit_pricing_measure>15oz</g:unit_pricing_measure>
<g:unit_pricing_base_measure>50oz</g:unit_pricing_base_measure>
</item>
</channel>
</rss>
|
Look through the file at GitHub
Now, if we compose a proper XSLT template, we can translate this XML file into the format supported by the Improved Import and Export extension.
Remember, you need to match the following formatting:
- XML 1.0
- encoding: UTF-8
- field separator: space
- first row: column names
- top-level root name: Items
- XML record name: item
Besides, you need to consider what attributes Magento 2 uses for identifying imported entity properties.
For the full list of attributes, refer to the dedicated article. The full list of articles can be found here:
Magento 2 import/export guide list
Having considered the XML table formatting and attribute names supported by Magento 2, we can compose a proper XSLT template.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<?xml version=“1.0” encoding=“UTF-8”?>
<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform” xmlns:g=“http://base.google.com/ns/1.0”>
<xsl:output method=“xml” version=“1.0” encoding=“UTF-8” indent=“yes”/>
<xsl:template match=“channel”>
<xsl:element name=“Items”>
<xsl:for-each select=“item”>
<xsl:element name=“Item”>
<xsl:element name=“sku”>
<xsl:value-of select=“g:id”/>
</xsl:element>
<xsl:element name=“name”>
<xsl:value-of select=“g:title”/>
</xsl:element>
<xsl:element name=“categories”>
<xsl:variable name=“newtext” select=“translate(g:google_product_category,’>’,”)”/>
<xsl:value-of select=“$newtext”/>
</xsl:element>
<xsl:element name=“url_key”>
<xsl:value-of select=“translate(substring-after(g:link, ‘http://’),’.html’,”)”/>
</xsl:element>
<xsl:element name=“image”>
<xsl:value-of select=“g:image_link”/>
</xsl:element>
<xsl:element name=“additional_images”>
<xsl:for-each select=“g:additional_image_link”>
<xsl:variable name=“count” select=“position()”/>
<xsl:if test=“$count > 1”>,</xsl:if>
<xsl:value-of select=“string(.)”/>
</xsl:for-each>
</xsl:element>
<xsl:element name=“is_in_stock”>
<xsl:choose>
<xsl:when test=“g:availability = ‘in stock'”>
<xsl:value-of select=“1”/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=“0”/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name=“price”>
<xsl:variable name=“newtext” select=“translate(g:price,’ EUR’,”)”/>
<xsl:value-of select=“$newtext”/>
</xsl:element>
<xsl:element name=“manufacturer”>
<xsl:value-of select=“g:brand”/>
</xsl:element>
<xsl:element name=“color”>
<xsl:value-of select=“g:color”/>
</xsl:element>
<xsl:element name=“size”>
<xsl:value-of select=“g:size”/>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
|
Look through the file at GitHub
If you know how to interpret XML, you can see that in the XSLT we are mapping initial XML table values to the required.
Now that we have an XML file and its interpretation in XSLT, we can compose an import job.
Composing an import job
In this post, we are providing a basic Improved Import and Export workflow example. If you want to learn more about how to create an import job, read through the extension manual.
Step 1: Create an import job
Navigate to your Magento 2 admin panel and proceed to System > Improved import/export > Import Jobs and click the ‘Add New Job’ button.
Step 2: Fill in general information and import entity type
Run through the general settings, select the imported entity, and upload your XML table.
Step 3: Paste XSLT template
Proceed to the ‘XSLT Configuration’ section and paste the composed XSLT template.
Then, click the ‘Test XSL Template’ button. The extension will run a test to make sure the XSL template is composed properly. If the template is ok – proceed to run the job.
Step 4: Run the job
Complete the rest of the settings and hit the ‘Save & Run’ button.
That’s it. You have just imported a custom-formatted XML table to your Magento 2 store.
Export use case for XSLT in Magento 2
Now, how can you benefit from XSLT while exporting entities from Magento 2? The first thing that comes to mind is synchronization with your CRM system. For example, if you need to track sales and new customers.
Your CRM probably supports a dedicated XML file format. With the help of XSLT, you can translate XML files Improved Import and Export extension gives to you into a format supported by your CRM system.
Composing an export job
Let’s compose a sample export job with reference to the Criteo file we tried importing in the Import use case.
Step 1: Create an export job
Navigate to your Magento 2 admin panel and proceed to System > Improved import/export > Export Jobs and click ‘Add New Job’ button.
Step 2: Fill in general information and export entity type
Run through the general settings and select the exported entity.
Step 3: Paste XSLT template
Proceed to the ‘XSLT Configuration’ section and paste the composed XSLT template.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<?xml version=“1.0” encoding=“UTF-8”?>
<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform” xmlns:g=“http://base.google.com/ns/1.0”>
<xsl:output method=“xml” version=“1.0” encoding=“UTF-8” indent=“yes”/>
<xsl:template match=“Items”>
<xsl:element name=“rss” xml:lang=“g” namespace=“http://www.yoursite.com/us/”>
<xsl:attribute name=“version”>2.0</xsl:attribute>
<xsl:element name=“channel”>
<xsl:element name=“title”>Title</xsl:element>
<xsl:element name=“link”>http://www.yoursite.com/us/</xsl:element>
<xsl:for-each select=“item”>
<xsl:element name=“Item”>
<g:id><xsl:value-of select=“sku”/></g:id>
<g:title><xsl:value-of select=“name”/></g:title>
<g:google_product_category>
<xsl:variable name=“newtext” select=“translate(categories,”,’>’)”/>
<xsl:value-of select=“$newtext”/>
</g:google_product_category>
<g:link>
<xsl:value-of select=“url_key”/>
</g:link>
<g:image_link>
<xsl:value-of select=“image”/>
</g:image_link>
<xsl:call-template name=“split”>
<xsl:with-param name=“list” select=“additional_images” />
<xsl:with-param name=“separator” select=“‘,'” />
</xsl:call-template>
<g:availability>
<xsl:choose>
<xsl:when test=“is_in_stock = 1”>
<xsl:text>in stock</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>in not stock</xsl:text>
</xsl:otherwise>
</xsl:choose>
</g:availability>
<g:price>
<xsl:value-of select=“price”/>
<xsl:text> EUR</xsl:text>
</g:price>
<g:brand>
<xsl:value-of select=“manufacturer”/>
</g:brand>
<g:color>
<xsl:value-of select=“color”/>
</g:color>
<g:size>
<xsl:value-of select=“size”/>
</g:size>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template name=“split”>
<xsl:param name=“list” select=“”” />
<xsl:param name=“separator” select=“‘,'” />
<xsl:if test=“not($list = ” or $separator = ”)”>
<xsl:variable name=“head” select=“substring-before($list, $separator)” />
<xsl:variable name=“tail” select=“substring-after($list, $separator)” />
<xsl:if test=“not($head = ”)”>
<g:additional_image_link>
<xsl:value-of select=“$head”/>
</g:additional_image_link>
</xsl:if>
<xsl:if test=“not($tail = ”)”>
<g:additional_image_link>
<xsl:value-of select=“$tail”/>
</g:additional_image_link>
</xsl:if>
<xsl:call-template name=“split”>
<xsl:with-param name=“list” select=“$tail” />
<xsl:with-param name=“separator” select=“$separator” />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|
Look through the file on GitHub
Then, click the ‘Test XSL Template’ button. The extension will run a test to make sure the XSL template is composed properly. If the template is ok, proceed to run the job.
Keep in mind that Improved Import and Export allows using php. functions in the XSLT configuration. Just create a helper within a custom module and call a method to update a value or format, or any php. side operation.
For example, the XSLT configuration of a file with orders from Acumen should look like:
<xsl:element name=”OrderDate”>
<xsl:value-of select=”php:function(‘FirebearCustomImportExportHelperAcumenOrderExport::toAcumenDate’, string(created_at))”/>
</xsl:element>
Step 4: Run the job
Complete the rest of the settings and hit the ‘Save & Run’ button.
That’s it. You have just exported a custom-formatted XML table from your Magento 2 store.
How to Compose XSLT Template for Magento 2 Open Source and Adobe Commerce
To compose XSLT templates, you need to understand how to use and interpret XML. For a regular Magento 2 store administrator, this can be a challenging task.
That’s why FireBear Studio offers assistance with composing XSLT templates. If you are not sure how to do it, feel free to contact our support team:
Send us a message
We can compose an XSLT template for you!
You can get:
- Assistance with installing and configuring the Improved Import and Export extension for Magento 2;
- Consultation on importing different Magento 2 entities;
- Answers to your questions about automating import/export processes.
Buy Improved Import Magento 2 Extension
Final Words: Import Any XML to Magento 2 with XSLT in 2026
Even in 2026, working with XML data from suppliers, CRMs, ERPs, PIMs, marketplaces, and other external systems can still become complicated when every system uses its own file structure and attribute naming conventions. XSLT transformation solves this problem by allowing you to adapt custom XML files to the structure required by Magento 2 without manually rebuilding your data files.
With Improved Import & Export for Magento 2, you can apply XSLT transformations directly within your import and export jobs. This makes it possible to work with custom XML structures, map external attributes to Magento attributes, transform values, and prepare data for different systems. The extension also supports scheduled import and export processes and connections with sources such as FTP/SFTP, Google Sheets, Dropbox, direct URLs, and APIs.
However, not every integration follows the same rules. If you need to connect Magento 2 with a CRM, ERP, PIM, supplier platform, marketplace, or another external system and are unsure how to structure the data exchange, FireBear Studio can help.
Contact FireBear Studio to discuss your Magento 2 import, export, data transformation, or integration requirements. Our team can help you determine the right approach, including custom XSLT transformations and data synchronization workflows tailored to your systems.
FAQ About Magento 2 XSLT for Import and Export
What is XSLT transformation in Magento 2?
XSLT transformation in Magento 2 is a way to convert an XML file from one structure or format into another. It is especially useful when a supplier or external system provides XML data that does not match Magento 2’s required import structure. With XSLT, you can transform XML elements, attributes, values, and data structures before Magento processes the file.
Can I import any XML file into Magento 2?
Not directly. Magento 2 expects imported data to follow specific structures and attribute names. If an XML file from a supplier, ERP, CRM, or another external system uses a different structure, it must first be transformed into a Magento-compatible format. XSLT can help adapt custom XML files without manually editing every file.
How can I import custom XML into Magento 2?
To import custom XML into Magento 2, you need to transform the source file so that its structure and attributes correspond to Magento’s import requirements. With the Improved Import & Export extension, you can use XSLT transformations to convert custom XML data and then configure the import job to process the resulting structure.
Why doesn’t Magento 2 recognize my XML product attributes?
Magento 2 may not recognize XML product attributes when the names or structure used by the source file differ from Magento’s attribute codes and import requirements. For example, an external system may use product_name, while Magento expects name. An XSLT transformation can rename or restructure these fields before the data is imported.
Can XSLT transform supplier XML files for Magento 2?
Yes. XSLT is particularly useful for supplier XML files because suppliers often use their own product data structures. You can transform elements, rename fields, reorganize product information, modify values, and prepare the XML for Magento 2 import. This makes it possible to automate imports even when suppliers use different XML formats.
Can I use XSLT when exporting Magento 2 data?
Yes. XSLT can also be used as part of an export workflow. This is useful when an external system, such as a CRM, ERP, PIM, or marketplace, requires a specific XML structure. Instead of changing the Magento data itself, you can transform the exported XML into the format required by the destination system.
Can I connect Magento 2 with external systems using XML and XSLT?
Yes. XML and XSLT can be used as part of Magento 2 integrations with external systems. For example, you can import product data from a supplier or PIM and transform it into a Magento-compatible structure. You can also export Magento data, transform the XML, and prepare it for a CRM, ERP, marketplace, or other business application.
What Magento 2 data can be transformed with XSLT?
The exact data depends on the XML structure and the import or export workflow, but XSLT can be used to transform many types of structured data, including product information, attributes, categories, prices, inventory values, customer data, and other entities supported by the integration. It can also modify the structure and values of XML elements to meet the requirements of another system.
Do I need to manually edit XML files before importing them into Magento 2?
Not necessarily. If your XML files follow a consistent custom structure, you can use an XSLT transformation to automate the required changes. This can eliminate repetitive manual editing and make recurring supplier or external-system imports much easier to maintain.
How can I import and export custom XML between Magento 2 and external systems?
The most flexible approach is to combine a Magento 2 import/export solution with data transformation. The Improved Import & Export extension lets you create import and export jobs and use XSLT to adapt XML structures to the requirements of Magento 2 or external systems. If the integration involves a complex or highly customized XML format, you can also contact Firebear Studio for assistance with Magento 2 import, export, and external-system integrations.

Please enable JavaScript to view the comments powered by Disqus.






