Free Tool

XML to CSV Converter for package.xml, DMARC Reports and Sitemaps

Paste XML or open .xml, .gz and .zip files and get a CSV with one row per repeating element: a Salesforce package.xml as one row per member with its type, a DMARC report as one row per record with the reporter on every row. Free, in your browser, nothing uploaded.

Your XML

The converter needs JavaScript.

How It Works

The Rows, Found and Changeable

A CSV is one table; XML is a tree. The converter finds the element that repeats and makes each one a row. It knows six kinds of file by their top element: a Salesforce package.xml (one row per member), a DMARC aggregate report (one row per record), a sitemap, a sitemap index, an RSS 2.0 feed and an Atom feed.

For any other XML it takes the repeating element nearest the top that has attributes or child elements of its own; when several repeat at that depth, the one that occurs most often. Every repeating element is listed under One row per with its count, so one click makes the books of a shelf, or the DKIM results of a report, the rows instead.

Excerpt: one row per item

<item sku="0042">
  <p:name>Lead form widget</p:name>
  <p:price currency="EUR">49.00</p:price>
</item>
→ item/@sku, p:name, p:price/@currency, p:price

Try a Real Layout

Each example is written the way Salesforce, a mailbox provider or a website writes the file.

Salesforce

package.xml, One Row per Member

A Metadata API manifest groups its components by type: each types element holds one or more members and one name, the metadata type, such as CustomObject or Profile. A converter that takes types as the row puts the members side by side in numbered columns. Here each member is a row with its type next to it, so you can sort, filter and compare two manifests in a spreadsheet.

A member written as * stands for all components of that type, as Salesforce documents the wildcard; it stays in the table as it is. The API version from the version element is on every row too.

  • Recognised by its root, Package, in the namespace http://soap.sforce.com/2006/04/metadata, or without a namespace when it was pasted without one
  • Member, type and API version in three columns
  • Several manifests at once become one table with a #file column

For the Salesforce setup behind a deployment like this, see our Marketing Cloud Next consulting.

One row per member

/Package/types/name,/Package/version,members
CustomField,62.0,Account.Lead_Score__c
CustomField,62.0,Lead.Lead_Score__c
Flow,62.0,Lead_Scoring_Update
CustomTab,62.0,*
Profile,62.0,Marketing User
DMARC

DMARC Reports With the Reporter on Every Row

An aggregate report names the reporter, the report ID, the date range and the published policy once, then lists one record per sending source (RFC 7489, and RFC 9990 with its namespace). The converter makes each record a row and adds the report’s fields to every row, so the rows of several reports still say where they came from after you sort them.

A record with two DKIM signatures gets auth_results/dkim[1]/domain and auth_results/dkim[2]/domain, never just the first. Open a week of reports at once, as .xml, .gz or .zip: they become one table with a #file column, also when some come in the RFC 7489 format and some in the RFC 9990 namespace; a #namespace column then says which is which. To check the record you publish, use the DMARC checker.

Excerpt: columns of one record

/feedback/report_metadata/org_name
/feedback/policy_published/p
row/source_ip
row/count
auth_results/dkim[1]/domain
auth_results/dkim[2]/domain
auth_results/spf/result

What Becomes a Column

What becomes a column, what is left out, and where the converter stops.

  • 50MB per file, read in your browser
  • 100Rows in the preview
  • 0Bytes uploaded
  • Namespaces. Matched by their URI, never by their prefix, which the XML namespaces standard calls a placeholder. Two prefixes for one URI make one column; one prefix used for two URIs makes two, the second with a number, such as p_2. The result lists which label stands for which URI. Namespace declarations (xmlns) get no column.
  • Column names. The path below the row element, such as row/source_ip; attributes with @, such as enclosure/@url, and the row element’s own attributes with its name in front, such as item/@sku (./@sku when the row element holds an element of its own name in any file of the table), so no column name starts with a character Excel reads as a formula. An element that has child elements anywhere in the table writes its own text as #text, so a category that holds subcategories keeps its name apart from theirs. Fields from above the row start with /, such as /feedback/report_metadata/org_name, and can be switched off.
  • Repeated elements. Numbered columns, dkim[1] and dkim[2], or one cell with the values joined by “; ” in file order, a missing value as an empty place, so the columns of one repeating element line up; for repeats inside repeats, use numbered columns. For one row each, pick the element under One row per. Inside the row no repeat is dropped; above the row, a repeating element with fields of its own is left out and named in the result.
  • Text. Kept as it is in the file, and CDATA is text. Spaces and line breaks between elements are layout and left out. Values that start or end with them are counted and trimmed only when you tick Trim. Comments and processing instructions are not data; the result says how many were left out.
  • Empty or missing. An empty element, such as <sp/>, gets its column and an empty cell. A missing element leaves the cell empty too, so the CSV cannot tell the two apart. An element with attributes and no text gives only its attribute columns.
  • Files. .xml, .gz and .zip, also an archive inside an archive, up to 50 MB per file and 200 MB unpacked. The encoding comes from the byte order mark or the XML declaration. A DOCTYPE that declares entities is refused, and nothing is fetched from the internet. Excel’s XML Spreadsheet 2003 files are refused too, because their cells can skip columns: save them as .xlsx and use the Excel to CSV converter.
  • Formulas. A value Excel would read as a formula, such as =SUM(…) or @name, gets an apostrophe in front, so Excel shows it and never runs it. Numbers and phone numbers stay as they are. For an import, a switch leaves values that start with +, - or @ unchanged.
  • Excel’s limits. A worksheet holds 1,048,576 rows and 16,384 columns, and a cell 32,767 characters (Microsoft’s specifications); the result warns when the table passes one. Excel also removes leading zeros and keeps 15 digits of a number when it opens a CSV directly, so the result names such values.

XML to CSV FAQ

Short answers to what people ask about turning XML into a spreadsheet.

How do I convert XML to CSV or Excel?

Paste the XML above or open the file. The converter picks the repeating element as the row and gives you a CSV to download or copy. To keep IDs and codes as typed in Excel, import the CSV with Data > From Text/CSV and set those columns to Text.

Why does my CSV have only one row?

The row element occurs once in the file. Pick the element that repeats, such as item or record, under One row per; each element in the list shows how often it occurs.

How do I convert nested XML?

Nested elements become columns named by their path below the row, such as row/policy_evaluated/disposition. An element that repeats inside a row becomes numbered columns, or one cell with the values joined, as you choose.

How are XML attributes handled?

Each attribute gets its own column, named with an @, such as enclosure/@url, or item/@sku for an attribute of the row element itself. Namespace declarations (xmlns) are not data and get no column.

Can I convert a sitemap.xml?

Yes. Each url becomes a row with loc, lastmod, changefreq and priority. Images from Google’s image extension come along as image:image/image:loc, or numbered, image:image[1]/image:loc and image:image[2]/image:loc, when a page in the file lists more than one.

How do I combine several XML files into one CSV?

Open them together or as one .zip. Files with the same row element become one table with a #file column that names the file of each row. Files with another layout get their own table, and Download All Tables gives one ZIP.

Why are umlauts and accents garbled?

Usually the CSV was opened with the wrong encoding. The converter reads the encoding from the XML file and writes UTF-8 with the byte order mark Excel looks for, unless you switch it off.

Is my XML uploaded?

No. The files are unpacked, read and converted in your browser. Nothing is sent or stored, and nothing from them reaches analytics.

We Make Salesforce Marketing Work for You

Talk to a certified consultant, not a salesperson, and leave the first call knowing your next step.