UltConvert

XML to DOCX Converter

Put the records of an XML export, feed or report into a table in a Word document, so people who never open raw XML can read, edit and print the data.

Data Converter

or drag CSV, TSV, TXT … files here ·

Up to 95 MB each· 20 files at once· Removed after 30 min

Output

Your files are removed from our servers 30 minutes after processing.

Files are deleted 30 minutes after processingPrivacy policy

What will the Word document contain?

A table: every repeating record in the XML becomes one row, and its child elements and attributes become the columns, with the field names in the header row.

Output
DOCX
Header row
Field names
Encoding
UTF-8

How DOCX became a published standard

  1. Specification

    Ecma International ECMA-376

    Source
  2. Specification

    ISO/IEC 29500-1

    Source

From machine data to a page people read

XML files are written for programs. Accounting systems export invoices as XML, online shops publish product feeds in it, government portals return search results in it, and many applications save their settings and records that way. The format is a W3C standard, first published as XML 1.0 in February 1998, and its strength is that any program can read it reliably.

People find it much harder. Opened in a browser or text editor, an XML export is a wall of angle brackets in which the actual values are easy to miss. When a manager, a client or an auditor needs to look at the records, a table in a Word document is far more useful: it reads like a report, it can sit next to written notes, and it prints on ordinary pages.

XML

XML file

Extensible Markup Language, a W3C standard from 1998 for structured data described with custom tags. Feeds, configuration files, office documents and many business systems rely on it. It is more verbose than JSON, and viewing it as a table usually requires a conversion.

  • Open standard

DOCX

Word document

Microsoft Word's default format since 2007, based on the openly published Office Open XML standard. It stores editable text with styles, tables, images and comments in a zipped package. Word, Google Docs, LibreOffice and Pages all open it, though complex layouts can shift slightly between programs.

  • Open standard

Why convertYou give up XML's machine-readable tags for a document people read and annotate. Convert when the data has to go into a report, a letter or a printout; keep the XML when another program still has to import it.

How elements turn into rows and columns

Most data XML follows one pattern: a root element that holds many copies of the same record. A file of orders has an order element repeated for every order, each with fields such as date, customer and total inside. The converter finds that repeating record and writes one table row for each copy, in the order they appear in the file.

The fields inside a record become the columns, and their names fill the header row because First row is header is on. Attributes are read as fields too, so a record written as order id="17" gets an id column. A record that lacks a field simply leaves that cell empty rather than shifting the other values.

Nested records

A record inside a record, such as several line items within one order, does not fit a flat table well. For deeply nested files, convert to XML to JSON or a spreadsheet first and pick the level you need.

Namespaces

Prefixes such as ns: in element names are part of the name. They show up in the column headers, and you can rename the headers in Word afterwards.

Text encoding

UTF-8 is preset because the XML standard makes it the default. Pick another encoding only if the file's first line declares one, for example windows-1252.

Dates

Dates are copied exactly as written in the XML. Choose an ISO or day-month-year format under Advanced settings if the readers expect a different style.

XML inside a DOCX is a different thing

It is easy to assume that a Word file is just another XML file, and in a sense it is. Since Word 2007, a .docx is a ZIP package that holds several XML parts, written to the Office Open XML rules standardized as ECMA-376 and later ISO/IEC 29500. But those parts describe paragraphs, styles and table cells in Word's own vocabulary, which is why your data XML cannot simply be renamed and opened.

The converter takes your values and writes them into that vocabulary, so the result is a normal Word document with one real table in it. You can change fonts, add a title and an introduction, apply a table style or delete columns you do not need, exactly as with any table you typed yourself.

Choosing between Word, Excel and HTML

Word is the right home for the data when it is going to be read, discussed or printed as part of a document. If the readers need to sort, filter or add up the values, a spreadsheet works better; the Data Converter writes XLSX and CSV from the same XML. For a table that will be shown on a website, an HTML table is the simpler target, much like JSON to HTML does for JSON files.

Up to 20 files fit in one batch, each up to 95 MB, and every file gets its own Word document. Uploaded files are removed after processing, and the converted ones 30 minutes later.

How to convert XML to DOCX

  1. Add the XML files

    Drop one or more .xml files on the box above, or press Choose Files. Exports, feeds and data dumps all work.

  2. Check the output

    DOCX is selected, with field names as the header row. Change the text encoding under Advanced settings only if the file is not UTF-8.

  3. Convert and open in Word

    Press Convert, download the .docx and open it in Word, Google Docs or LibreOffice Writer.

XML to DOCX questions

Which part of my XML becomes the table rows?

The element that repeats, such as every order in a list of orders or every item in a feed. Each one becomes a row, and the fields inside it become the columns.

Do XML attributes appear in the Word table?

Yes. An attribute such as id="42" on a record is treated like a child field and gets its own column next to the element values.

Can I convert a DocBook or other document-style XML file into formatted Word text?

Not on this page. It reads XML as data and lays the records out as a table, so a book or article marked up in XML comes out as a table of its elements rather than as headings and paragraphs.

Why not just rename the .xml file to .docx?

A DOCX is a ZIP package of several XML parts written to the Office Open XML rules, so Word rejects a single plain XML file with a new extension. Converting builds that package around your data.

Is Word the right target for a very large XML export?

Usually not. A table with thousands of rows is slow to scroll and hard to print. For large exports, XML to Excel gives you sorting and filtering, and the Word file is better kept for a short extract.

Other ways to get XLSX
Other ways to get HTML
Other ways to get CSV
Other CSV conversions
Other HTML conversions
Related conversions

From the blog