Export XML Data Through XML Maps
Once you have created lists containing XML data, you can export that data to a new XML file from Excel two ways:
By saving the workbook using the XML Data file type
By clicking the Export XML toolbar button or selecting Export from the Data menu’s XML submenu
In either case, you can export data using only one XML map at a time. If a workbook contains more than one XML map, you are prompted to choose the map to use, as shown in Figure 15-13.

Figure 15-13. Exporting XML uses only one XML Map at a time
When Excel exports a list as XML, it uses the schema stored in the workbook to generate XML that matches the XML source file that the list was created from. However, Excel omits the following items:
Schema definitions
Processing instructions
XML nodes not included in the list
For example, if you create a list from SimpleOrder.xml containing only names and totals, only those elements are saved when you export the list as XML (shown here):
<Orders>
<Order>
<BillTo>
<Address>
<Name>Joe Magnus</Name>
</Address>
</BillTo>
<Total>
<Due>572.4</Due>
</Total>
</Order>
<Order>...</Order
</Orders>In the preceding XML, the original address and order information is omitted because it wasn’t included in the list. From Excel’s point of view, the data doesn’t exist if it doesn’t reside on a worksheet somewhere.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access