Creating Advanced XML Output with Dynamic Values
Deviking Product Feeds Pro gives you full control over the structure and content of XML product feeds.
In addition to selecting standard WooCommerce fields, you can build custom XML structures, insert dynamic product values, combine multiple sources into a single field, add attributes, repeat elements, preserve HTML, use CDATA, and create output that matches the exact requirements of a marketplace or external platform.
Creating an XML Feed
Go to:
Deviking Feeds → Feeds
Create a new feed or edit an existing one and select XML as the feed format.
You can then configure the XML structure and define the fields that should be generated for every product.
A simple product record might look like:
<product>
<id>1234</id>
<title>Running Shoes</title>
<price>89.90</price>
</product>Each XML element is controlled by a Mapping row.
Mapping Product Data to XML Elements
For every output field, select the WooCommerce source that should provide its value.
For example:
Output Field: id
Source: Product IDOutput Field: title
Source: Name / TitleOutput Field: price
Source: Current PriceThe feed generator resolves the selected source separately for every exported product.
Using Nested XML Paths
XML fields can be organized into nested structures when required by the destination platform.
For example:
<product>
<identity>
<sku>SHOE-001</sku>
<brand>Example Brand</brand>
</identity>
<pricing>
<price>89.90</price>
<currency>EUR</currency>
</pricing>
</product>Use the XML field path configuration to define the required hierarchy.
This allows you to reproduce marketplace XML specifications without modifying WooCommerce product data.
Using Dynamic Values
Feed values do not have to contain only one WooCommerce field.
Deviking Product Feeds Pro can use dynamic values from product data throughout the feed configuration.
Supported sources can include:
- Product fields
- Prices
- Stock data
- Product attributes
- Custom fields
- Taxonomies
- Category Mappings
- Dynamic Attributes
- Parent product data
- Other available feed sources
Combining Multiple Product Fields into One Value
With Composite / Merged Values, multiple sources can be combined into a single result.
For example:
{{source:name}} - {{source:attr:pa_color}} - {{source:attr:pa_size}}could produce:
Running Shoes - Black - XLThis is particularly useful when an XML specification requires one field containing information that is stored separately in WooCommerce.
Example: Custom Product Label
You could create a Dynamic Attribute containing:
{{source:brand}} - {{source:name}} - {{source:sku}}and use it as the source of an XML field:
<product_label>
Example Brand - Running Shoes - SHOE-001
</product_label>The value is generated individually for every exported product.
Insert Source
When building Composite / Merged Values, the Insert Source helper can be used to insert available product sources into the value.
This avoids manually typing source placeholders.
For example, you can combine:
Product Name
Static text
Color
Static text
Sizeto build:
{{source:name}} / {{source:attr:pa_color}} / {{source:attr:pa_size}}Using Dynamic Attributes in XML
Dynamic Attributes can be selected as normal mapping sources.
They are especially useful when the XML value depends on conditions.
For example:
IF Stock Status equals instock
→ available
IF Stock Status equals onbackorder
→ preorder
ELSE
→ unavailableThe Dynamic Attribute can then be mapped to:
<availability>available</availability>or:
<availability>preorder</availability>depending on the product.
Conditional Numeric Values
Dynamic Attributes can also calculate numeric results.
For example:
IF Category contains Clearance
Base Source:
Current Price
Operation:
Decrease by %
Value:
20You can then use that Dynamic Attribute as the value of:
<price>79.92</price>The WooCommerce product price itself remains unchanged.
WooCommerce Tax-Aware Prices in XML
XML mappings can use WooCommerce tax-aware price sources.
Available sources include:
Including tax
- Regular Price incl. tax
- Sale Price incl. tax
- Current Price incl. tax
Excluding tax
- Regular Price excl. tax
- Sale Price excl. tax
- Current Price excl. tax
For example:
<price_with_tax>124.00</price_with_tax>
<price_without_tax>100.00</price_without_tax>The values are calculated using WooCommerce tax handling rather than a manually entered VAT percentage.
Numeric Modifier
A Mapping row can apply a Numeric Modifier before formatting the value.
Available operations include:
- Add fixed amount
- Subtract fixed amount
- Increase by percentage
- Decrease by percentage
- Multiply by
- Divide by
For example:
Source:
Current Price incl. tax
Numeric Modifier:
Increase by %
Value:
5A source value of:
100becomes:
105before the normal Transform and XML output steps are applied.
Mapping Processing Order
Values in a Mapping row are processed in the following order:
Source
→ Fallback Source
→ Numeric Modifier
→ Transform
→ Prefix / Suffix
→ XML OutputThis allows calculation, formatting and final output decoration to remain separate.
Fallback Sources
A Mapping row can define a Fallback Source.
The fallback is used only when the primary Source is empty.
For example:
Source:
Sale Price
Fallback Source:
Regular PriceIf Sale Price contains a value, that value is used.
If Sale Price is empty, Regular Price is used instead.
The resolved value then continues through Numeric Modifier, Transform and Prefix / Suffix.
Adding Prefix and Suffix Values
Mapping rows can add text before or after the resolved value.
For example:
Prefix:
SKU-could convert:
12345into:
SKU-12345Prefix and Suffix can also use supported dynamic source placeholders.
For example:
Suffix:
{{source:currency}}could produce:
89.90 EURwhen the currency source returns EUR.
XML Attributes
XML elements can include attributes when required by the destination specification.
For example:
<price currency="EUR">89.90</price>or:
<identifier type="sku">SHOE-001</identifier>XML attributes can be configured independently from the element value.
Repeated XML Elements
When a source contains multiple values, XML elements can be repeated.
For example, a product containing several images could be represented as:
<image>https://example.com/image-1.jpg</image>
<image>https://example.com/image-2.jpg</image>
<image>https://example.com/image-3.jpg</image>When Repeat XML is enabled, each available source value can generate its own XML element.
The selected Transform and Prefix / Suffix are applied to each repeated value.
CDATA
CDATA can be enabled for individual XML mappings when raw text or markup needs to be protected from normal XML escaping.
For example:
<description><![CDATA[
<p>Lightweight running shoes with breathable upper.</p>
]]></description>CDATA is configured independently for each mapping row.
Preserving HTML
When HTML should remain in the exported value, use the Preserve HTML Transform.
This is useful for:
- Product descriptions
- Short descriptions
- Custom HTML fields
For example, WooCommerce content such as:
<p><strong>Premium</strong> running shoes.</p>can remain formatted instead of being converted to plain text.
If the destination XML requires the markup inside CDATA, enable CDATA separately on the mapping row.
Removing HTML
If the destination requires plain text instead, select:
Transform → Strip HTML
For example:
<p><strong>Premium</strong> running shoes.</p>becomes:
Premium running shoes.Custom XML Header and Footer
Advanced XML feeds can include custom content before or after the main XML document structure.
The XML Header is placed before the feed root.
The XML Footer is placed after the closing root element.
This is useful when an integration requires additional output surrounding the generated document.
Before and After Products
Custom XML content can also be added around the generated product records.
This allows more complex structures to be created without manually generating the complete feed.
Feed Tokens
Custom XML areas can use supported feed-level tokens.
Available examples include:
{{timestamp}}
{{generated_at}}
{{generated_at:Y-m-d H:i}}
{{site_name}}
{{site_url}}
{{site_description}}For example:
<generated_at>{{generated_at:Y-m-d H:i}}</generated_at>can be used to include the feed generation date and time.
Variations and XML Output
The XML structure works with all supported Product & Variation Modes.
When a variation is exported, variation-aware sources can return data belonging to that specific variation, such as:
- SKU
- Current Price
- Regular Price
- Sale Price
- Stock quantity
- Selected attributes
- Variation image
Where appropriate, parent-aware sources can be used to retrieve information from the parent variable product.
Best Practices
Build the XML structure according to the specification provided by the destination platform.
Use Dynamic Attributes when a field requires conditional logic.
Use Composite / Merged Values when one XML element must contain multiple pieces of product information.
Use WooCommerce tax-aware price sources instead of manually adding or removing VAT.
Use Numeric Modifier for actual numeric calculations and Number Format for presentation.
Use CDATA only where required.
Use repeated XML elements for genuinely multi-valued sources rather than joining values manually when the destination expects separate elements.
Always generate and validate the feed after making structural XML changes.