XML to Word fill

How to Convert XML to Word

XML Merge

Many of us are familiar with mail merge - merging Excel data with word documents. How about merging XML to Word? XML is the universal standard for data interchange and Microsoft Word is the most popular document format. Often times you find a need to populate XML file to word document. Let me narrate my own experience.


Why convert XML to Word

Once I landed in a situation, where I had to fill a word template with an XML file to generate a document that was to be shared with vendors. The word document has corporate branding-Header, Footer, Logo etc. and contained around 15 dynamic fields. Over a period of time, the number of XML files I received per day started increasing. It reached 5-6 XML files per day, which translates to the manual filling of documents by cut-and-paste 5-6 times a day. You can imagine how frustrating and painful this tedious job is.

Then I started searching for software/tools to automate this task. Unfortunately, I couldn’t find a simple tool that addresses my requirement but only came across APIs, code samples, and libraries i.e. all geeky stuff. I used one of the libraries and did some coding to convert XML to Word.

I am sure some of you would have come across these situations with XML files in your day-to-day business.

  1. Your CRM allows you to export data in XML format and you want to export that data into your proposal template to create proposals real fast.
  2. You export data from your Database in XML format and want to export that into a Word document as per your company’s branding guidelines
  3. You receive a customer response in XML format and want to populate that data into a word template for companywide distribution.
Whatever be the scenario, converting XML to Word brings in a lot of productivity gains and reduce manual errors.

Start XML to WORD Population

XML to Word - Approaches


There are different approaches to achieve this. The most common approach is to employ IT team to build a tool for populating XML to Word document. This is an expensive option both from development and maintenance perspective.

Another familiar approach is “Save As” XML file as Word document and cut-and-paste data that into a template. What an epic waste of time. You don't gain any productivity improvements with this approach.

DIY SAAS is the best approach but as I said before not many solutions are available.So we built EDocGen. EDocGen is DIY SAAS software for populating XML to Word document built for business users and sysadmins.


Why EDocGen

If you are looking for a DIY system to generate documents from XML data then possibly EDocGen is the only solution. With intutive interface, you can map dynamic fields of document to XML data thus controlling the the data you wish to show on your document.

It supports dynamic population of text, tables, content blocks, hyperlinks and images from XML data

EDocGen is the perfect solution to auto-fill XML file to Word template.

Ease of Template creation: Business uses use existing document templates to auto-generate documents. It doesn't force users to switch to system's templates/formats. Business users can convert existing document into template just by adding few tags into their word document template. Then populate these templates with XML data to generate documents.

Top notch performance: Generate thousands in few seconds to few minutes depending on the complexity of template

Four level XML: Supports population of upto 4-level XML into word template

EDocGen supports both on-demand and bulk document generation. Following sections describe how to convert XML to Word using EDocGen.

There are two ways to populate XML file using EDocGen - Through App UI and API.

App UI - XML to Word Documents


The first step is to convert existing word document into EDocGen template. It's a very simple step.Just add the relevant dynamic tags for text, tables, images, text areas, and content blocks. EDocGen uses these tags to identify the dynamic sections of the template. After adding tags, upload template into EDocGen.



Hover over document template to see “Create Document” action button. Click on it and in the drop-down select “generate documents from XML". Upload XML and map XML elements to template's dynamic fields. Click generate button to create documents.

XML to Word Document Generation


As you can see, no XML data transformation is required for XML to Word document creation. You can use any XML file format and populate that into the template, using mapping screen. If you use the same XML file, again and again, mapping it every time is time-consuming particularly if you have a large number of dynamic fields in your template.

By adjusting XML elements in line with the template's dynamic fields, you can skip the mapping screen and auto-fill data. While creating XML, have template's dynamic tag names as XML elements.

API - XML file to Word Document Generation

EDocGen is API first product and supports nested tables for up to 4-level XML files.









It's Windows OpenXML based API that supports filling of dynamic text, tables, content blocks, hyperlinks and images in word templates with XML data. The process is very similar to above. In Step1, add relevant dynamic tags to your template. In step2, upload the template into EDocGen through API. In step3, call API function by passing template ID and XML file.

EDocGen is the simplest and fastest solution to convert XML file to Word, online or through API. Moreover, it supports multi-lingual templates, conditional statements (if-else), and calculations. For example you can populate XML data in French, Japanese, Spanish etc. to generate multi-lingual documents. Register and start populating your XML data into Word template.

Give it a try by registering. Trail is better than reading 1000 words.

Popular Posts

Auto Fill JSON to Word

Posted by admin

Mail Merge is one of the most popular features of Microsoft Office. Mail merge merges Excel

NextGen Document Generator

Posted by admin

Will you ever fill a document manually, if there is a choice to use a system/tool that