The first row should contain headers, which become your XML tag names. Each row after that is converted into values for those tags.
Example Input:
device,os,storage MacBook Pro,macOS,512GB Surface Laptop,Windows 11,256GB
The output XML will have a root element named <root>. And each CSV row becomes a <row> element, with
headers as child tags and cell values inside them.
The output of the above CSV will be:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<row>
<device>MacBook Pro</device>
<os>macOS</os>
<storage>512GB</storage>
</row>
<row>
<device>Surface Laptop</device>
<os>Windows 11</os>
<storage>256GB</storage>
</row>
</root>Empty values are converted to empty XML elements.
device,release_year iPhone 17, Pixel 10,2025
becomes:
<root>
<row>
<device>iPhone 17</device>
<release_year/>
</row>
<row>
<device>Pixel 10</device>
<release_year>2025</release_year>
</row>
</root>Special XML characters like <, >, &,
and quotes are automatically escaped in the output.
game,requirement Portal 2,RAM > 4GB & DirectX 9
becomes:
<row> <game>Portal 2</game> <requirement>RAM > 4GB & DirectX 9</requirement> </row>