Document Editing Problems

Create a Word Document with One XML Recipe per Page

Anum MushtaqAnum Mushtaq Nov 25, 2026 869 views

Question details

Create a Word document from updated XML recipe records, with each recipe and its ingredients on a separate page.

Create a Word Document with One XML Recipe per Page
Product
Microsoft Word and Microsoft Excel
Device & OS
not provided
Scenario
Multiple users continually update an XML source containing recipes and nested ingredient collections.
Observed behavior
The desired document contains one recipe per page, including its recipe fields and ingredient list.
Before you start

Check the XML structure to identify the recipe record, its fields, and the nested ingredient elements. Decide whether each ingredient list can be combined into one field or whether you need a custom document-generation process.

Solution 1Recommended

Use Excel and Word Mail Merge for Flattened Recipe Records

Use this method when the XML can be converted into one spreadsheet row per recipe.

1
Import the XML into Excel

In Excel, use Data > Get Data > From File > From XML, if available, and select the recipe XML file.

2
Prepare one row per recipe

In the import or query editor, arrange the data so each recipe has one row and each recipe field has a column. Combine its ingredients into a single text field before loading the table into a worksheet.

3
Save the data source

Save the worksheet as an Excel workbook. When the XML changes, refresh the query from Excel's Data tab and save the workbook again before merging.

4
Connect the workbook in Word

In Word, choose Mailings > Start Mail Merge > Letters. Select Mailings > Select Recipients > Use an Existing List, open the workbook, and choose the worksheet containing the recipe table.

5
Build and generate the recipes

Type the recipe layout in Word and use Mailings > Insert Merge Field to add the recipe fields and combined ingredient list. Choose Preview Results, then Finish & Merge > Edit Individual Documents to generate the document.

Use Excel and Word Mail Merge for Flattened Recipe Records
Check the page layout: A letters merge starts each record in a new section, but a long recipe can still overflow onto another page. Review the merged document and adjust the layout or content as needed.
Free Microsoft Office alternative

Review Recipe Documents with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Word documents and Excel workbooks. It supports a straightforward move to WPS, although it does not replace the custom XML transformation described above.

Review and edit generated recipe documents in WPS WriterCompatible with Microsoft Word DOCX and Excel XLSX formatsFamiliar editing interface for users moving from Microsoft OfficeFree, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can Word mail merge directly repeat nested ingredients for each recipe?

A standard mail merge works best with one flat row per recipe. Combine the ingredients into a field in Excel, or use a custom transformation or program to handle a variable-length ingredient collection.

How do I include new XML changes in the merged document?

Refresh the imported XML data from Excel's Data tab, save the workbook, and run Finish & Merge again in Word. An existing merged document does not automatically update when the XML changes.

Why does a recipe take up more than one page?

Starting each record on a new page does not guarantee that its content fits on one page. Use Preview Results in Word and adjust the font, margins, spacing, or recipe content if a record overflows.

When should I use the Open XML SDK instead of mail merge?

Consider the Open XML SDK when you need code to generate DOCX files with variable-length ingredient lists, custom tables, or controlled page breaks. For fixed fields that fit into one row per recipe, Word mail merge is usually simpler.