DataSwitch Pro Private, in-browser data converter

How to Open an XML File in Excel as a Table

By the DataSwitch Pro team · · 4 min read

Quick answer

In Excel for Microsoft 365 or Excel 2016 and later on Windows, go to Data → Get Data → From File → From XML, select the file, pick the table that holds the repeated records in the Navigator, and click Load (or Transform Data to expand nested columns). Alternatively, convert the XML to CSV with an XML to CSV converter and open the CSV — useful for feeds, sitemaps and other record lists.

Product feeds, sitemaps, bank exports and accounting systems often deliver XML. Double-clicking an XML file usually opens it in a browser as a tree of tags, which is hard to filter or total. Excel can turn the repeated records into rows and columns in a few steps.

Method 1: Get Data → From XML (Power Query)

  1. Open a blank workbook and choose Data → Get Data → From File → From XML.
  2. Select the XML file. The Navigator lists the tables Power Query found.
  3. Click the table that contains your records — for a product feed, the one named after the repeated element, such as product or item. The preview shows one row per record.
  4. Click Load for a flat result, or Transform Data if some columns show Table and need to be expanded with the two-arrow icon.
  5. Click Close & Load.

Like other Power Query imports, the result can be refreshed when the XML file changes.

Method 2: File → Open

Excel can also open an .xml file directly via File → Open. It then asks how to open it; As an XML table makes Excel infer a structure (and warns that it is creating a schema). This works for simple, flat files, but nested documents often produce many columns with repeated values. Power Query gives more control.

Method 3: Convert XML to CSV first

When the XML is a list of records and you just want a sheet, converting is often fastest:

  1. Open the XML to CSV converter and paste the XML or drop the file.
  2. The repeated element becomes rows; child elements and attributes become columns (nested ones with dot-separated names).
  3. Download the CSV and open it in Excel — or turn it into a real workbook with CSV to Excel so codes with leading zeros stay as text.

Example: a product feed

feed.xml

<products>
  <product sku="00412">
    <name>Ceramic mug</name>
    <price currency="EUR">12.50</price>
  </product>
  <product sku="00413">
    <name>Glass jar</name>
    <price currency="EUR">8.90</price>
  </product>
</products>

Resulting table

@sku   | name        | price.#text | price.@currency
00412  | Ceramic mug | 12.50       | EUR
00413  | Glass jar   | 8.90        | EUR

The @ marks values that came from attributes and #text is the text of an element that also has attributes. Rename the columns as you like after importing.

Common problems

Sitemaps: a quick SEO audit

Converting sitemap.xml gives a list of every URL with its lastmod date. Sort by date to find pages that have not been updated, or compare the list with your analytics to spot pages that get no traffic.

Try it on your own file. Free, private, and processed in your browser.

Frequently asked questions

Can Excel export back to XML?

Yes, but only through an XML map (Developer tab → Source), which needs a schema. For simple exports, saving as CSV and converting is easier.

Does Google Sheets open XML?

Its IMPORTXML function can read XML from a public URL with XPath queries, but there is no import for an XML file on your computer. Convert the file to CSV and import that.

Why are some cells showing “Table”?

Those columns contain nested elements. Click the expand icon in Power Query to turn them into columns or rows.

Is it safe to convert XML online?

With a browser-based converter that does not upload files, the XML never leaves your computer.

More guides