<!-- How to Open an XML File in Excel | DataSwitch Pro -->
<!-- Canonical: https://dataswitchpro.com/guides/open-xml-file-in-excel/ -->
> Open XML in Excel as a table with Get Data → From XML, File → Open, or by converting XML to CSV. Includes product feeds, sitemaps and nested XML.

[Home](https://dataswitchpro.com/) › [Guides](https://dataswitchpro.com/guides/)

# How to Open an XML File in Excel as a Table

By the DataSwitch Pro team · November 20, 2026 · 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](https://dataswitchpro.com/xml-to-csv/) 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](https://dataswitchpro.com/xml-to-csv/) 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](https://dataswitchpro.com/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

- **Only one row appears.** The import picked the wrong level, such as the root element. In Power Query, choose the table of the repeated element; in a converter, check which element repeats.
- **Leading zeros disappear** from SKUs or postcodes. Set those columns to Text in Power Query, or see [keeping leading zeros in Excel](https://dataswitchpro.com/guides/keep-leading-zeros-csv-excel/).
- **“The XML file is not well-formed”.** A tag is not closed, or the file contains an HTML entity such as `&nbsp;`. The error gives a line number; fix that line in a text editor.
- **Prefixed tags** such as `g:price` appear as column names. They are namespace prefixes and can be renamed safely.
- **Very deep nesting.** If the XML has several independent lists (orders with items and payments), import each list as its own table, linked by the order ID.

## 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.

[XML to CSV](https://dataswitchpro.com/xml-to-csv/)[XML to JSON](https://dataswitchpro.com/xml-to-json/)[CSV to Excel](https://dataswitchpro.com/csv-to-excel/)[Excel to CSV](https://dataswitchpro.com/excel-to-csv/)

## 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

- [How to Keep Leading Zeros (and Long Numbers) When Opening CSV in Excel](https://dataswitchpro.com/guides/keep-leading-zeros-csv-excel/)
- [Why Your CSV Opens in One Column in Excel (and How to Fix It)](https://dataswitchpro.com/guides/csv-opens-in-one-column-excel/)
- [Fix Garbled Characters (Ã©, â€™, Ã¨) in CSV Files Opened in Excel](https://dataswitchpro.com/guides/fix-garbled-characters-csv-excel/)
- [How to Flatten Nested JSON into a CSV Table](https://dataswitchpro.com/guides/flatten-nested-json-to-csv/)
