Excel has the option to export the schema. However, there are many cases where it will not function. https://support.microsoft.com/en-us/office/export-xml-data-0b21f51b-56d6-48f0-83d9-a89637cd4360#Common%20issues%20with%20exporting%20XML%20data

I did find a workaround. If you open the excel file as an archive with 7-zip or similar tool it contains a file called xmlMaps.xml. The file contains all the xml maps for the document. Use a text editor to save each schema in a separate xsd file.

Answer from CodeMonkey on Stack Overflow
🌐
Microsoft Support
support.microsoft.com › en-us › office › map-xml-elements-to-cells-in-an-xml-map-ddb23edf-f5c5-4fbf-b736-b3bf977a0c53
Map XML elements to cells in an XML Map - Microsoft Support
You create an XML Map by adding an XML schema to a workbook. The schema can be copied from an XML schema file (.xsd), or Excel can try to infer one from an XML data file (.xml).
🌐
The Bricks
thebricks.com › resources › guide-how-to-create-xml-schema-in-excel
How to Create XML Schema in Excel
February 20, 2025 - Excel will now analyze the file. If it doesn't have an associated schema, Excel will display a dialog box stating, "The specified XML source does not refer to a schema. Excel will create a schema based on the XML source data." Click OK.
Discussions

xml - How do I save a schema definition XSD file from Excel 2016? - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Excel 2016 can internally create an XML schema definition imported from an XML data file. It appears in the Excel "XML source" panel, listing the XML element hierarchy, which one can then map ... More on stackoverflow.com
🌐 stackoverflow.com
XML schema for Excel XML exportation - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I'm getting mad trying to create an XML schema to transform an Excel file to an XML file. More on stackoverflow.com
🌐 stackoverflow.com
xml - Generate XSD file from MS Excel file definition - Stack Overflow
Hi, I have an Excel that contains fields names and type like the following example. ID : INT First_Name : String Last_Name : String Phone number : String I would like to generate an XSD from the More on stackoverflow.com
🌐 stackoverflow.com
Existing XML Schema for excel
For each row, create new folder based on single cell value, then save exported XML doc to matching folder. ... We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com. ... Follow these easy steps to disable AdBlock 1)Click on the icon in ... More on mrexcel.com
🌐 mrexcel.com
1
0
May 12, 2024
🌐
Udemy
blog.udemy.com › home › how to convert data in excel to xml in 7 easy steps
How To Convert Data in Excel to XML in 7 Steps - Udemy Blog
October 24, 2025 - It is based on an XML schema, which defines the structure of the file. You can create it in NotePad. To convert the data, go to the Developer tab – Source. You can then load your XML schema and match it to the data.
🌐
O'Reilly
oreilly.com › library › view › programming-excel-with › 0596007663 › ch15s03s04s03.html
15.3.4.3. Create an XML schema - Programming Excel with VBA and .NET [Book]
April 25, 2006 - Create an XML schemaAllowing Excel to infer a schema for an XML map is fine if the nodes don’t contain optional items or if the first occurrence of each node contains all of its... - Selection from Programming Excel with VBA and .NET [Book]
Authors   Jeff WebbSteve Saunders
Published   2006
Pages   1114
🌐
Microsoft Support
support.microsoft.com › en-us › office › overview-of-xml-in-excel-f11faa7e-63ae-4166-b3ac-c9e9752a7d80
Overview of XML in Excel - Microsoft Support
Exporting revised data from mapped cells to an XML data file · You can create or open a workbook in Excel, attach an XML schema file (.xsd) to the workbook, and then use the XML Source task pane to map XML elements of the schema to individual cells or tables.
🌐
The Bricks
thebricks.com › resources › guide-how-to-create-xml-schema-in-excel-using-chatgpt
How to Create XML Schema in Excel Using ChatGPT
Learn how to create an XML schema in Excel using ChatGPT. Follow a simple step-by-step guide to convert your spreadsheet structure into a powerful, code-free XSD.
Find elsewhere
🌐
Excel Forum
excelforum.com › excel-formulas-and-functions › 1082846-creating-an-xml-file-with-a-specific-schema.html
Creating an XML file with a specific schema
May 15, 2015 - So I will simply copy and paste the Module1 code to any other new excel file I want to create an XML file with? Also, will it automatically generate other data missing from this example excel file (that are listed in the first XML schema example), such as "Product_Condition_Required", "Language_Optional" etc?
🌐
Spreadsheeto
spreadsheeto.com › home › blog › how to convert excel to xml – step-by-step tutorial
How to Convert Excel to XML - Step-by-Step Tutorial (2024)
January 16, 2026 - To convert Excel to XML, you need to create an XLS file containing all the data. I have created an example below that lists the members of a company and their details. Each field contains certain information about every employee.
🌐
Wayne State University
digitalcommons.wayne.edu › cgi › viewcontent.cgi pdf
XSD: The Path From Excel to XML: The Basics: Mapping ...
This paper will describe the basics of using XSD to map data from an Excel spreadsheet to an XML file. It will cover · setting up Excel for XML mapping and creating XSDs that map elements and attributes.
🌐
YouTube
youtube.com › conny söderholm
Mapping and importing/exporting an XML schema with Excel. - YouTube
Map an XML schema to Excel and export it. I will also show you how to import an XML schema to Excel.
Published   July 31, 2019
Views   2K
Top answer
1 of 2
3

Note: there is no solution using just Excel.

This was true in 2013 when the OP asked the question, and is still true now, as far as I can tell.

The answers provided on this page, though they use external tooling, represent the only solutions on the internet at this time, and have since been viewed 13,000 times.

If you or anyone you know have a solution using only Excel to generate XSD, please add it, because this is clearly something that would help many people.


Model the class in code:

public class Something
{
    public int ID { get; set; }
    public string First_Name { get; set; }
    public string Last_Name { get; set; }
    public string Phone_number { get; set; }
}

Save it to a .cs file and then compile it.

and then use xsd.exe to generate the xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Something" nillable="true" type="Something" />
  <xs:complexType name="Something">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="ID" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" name="First_Name" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Last_Name" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Phone_number" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
</xs:schema>
2 of 2
2
  1. In notepad, write your new schema like this:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <record>
       <ID>12345</ID>
       <FirstName>First Name</FirstName>
       <LastName>Last Name</LastName>
       <PhoneNumber>555-555-5555</PhoneNumber>
     </record>
     <record>
       <ID>12346</ID>
       <FirstName>John</FirstName>
       <LastName>Doe</LastName>
       <PhoneNumber>555-555-5555</PhoneNumber>
     </record>
    </data-set>
    
  2. Save the file as schema.xml

  3. Open your excel file.
  4. On the Developer tab, open the XML Source task pane.
  5. To add an XML map, click XML Maps

  1. Click Add
  2. Select schema.xml and click OK twice
  3. Now simply drag (map) the 4 elements from the tree onto the worksheet (row 1). Image shows the first two done.

  1. On the Developer tab, under the XML group, click Export.
  2. Save your file as data-set.xml and press Enter.

Result will look like this:

🌐
ExcelDemy
exceldemy.com › home › advanced excel › how to create a schema in excel (with detailed steps)
How to Create a Schema in Excel (with Detailed Steps) - ExcelDemy
June 21, 2024 - you can create a schema in Excel by creating the schema in the notepad first and then loading and mapping the Excel files.
🌐
Excel Easy
excel-easy.com › examples › xml.html
Convert XML to Excel - Step by Step Tutorial
First, we will create a schema based on XML source data. The schema defines the structure of the XML file. We have to do this outside Excel. 1. For example, open Notepad and add the following lines. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <record> <LastName>Smith</LastName> <Sales>16753</Sales> <Country>UK</Country> <Quarter>Qtr 3</Quarter> </record> <record> <LastName>Johnson</LastName> <Sales>14808</Sales> <Country>USA</Country> <Quarter>Qtr 4</Quarter> </record> </data-set>
🌐
Goamps
projects.goamps.com › proliance › help › content › XML_Layout › How_to_Attach_an_XML_Schema_to_an_Excel_Document.htm
Attaching an XML Schema to an Excel Document
... On the XML Source task pane (which should appear to the right of the application window), click XML Maps… to display the dialog for attaching a schema file to your workbook. If the schema you need is not already in the list in the XML Maps dialog, click Add… to browse for the file.
🌐
State
files.dep.state.pa.us › air › airquality › aqportalfiles › business topics › emission inventory › docs › excel_xml_primer.doc doc
Adding an XML Map (schema) to Excel - DEP
files.dep.state.pa.us - / · 5/21/2025 10:47 AM <dir> AboutDEP 8/23/2024 7:17 AM <dir> Accessibility 11/19/2015 10:39 AM <dir> AdvisoryComittees 4/7/2025 2:19 PM <dir> Air 7/11/2023 4:42 PM <dir> AlertsPage 2/11/2021 5:09 PM <dir> DataAndTools 2/5/2024 7:10 PM <dir> Energy 5/7/2018 2:09 PM ...
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Existing XML Schema for excel | MrExcel Message Board
May 12, 2024 - For each row, create new folder based on single cell value, then save exported XML doc to matching folder. ... We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com. ... Follow these easy steps to disable AdBlock 1)Click on the icon in the browser’s toolbar.
🌐
Excelgraduate
excelgraduate.com › home › blog › how to create an xml schema using data in excel
How to Create an XML Schema Using Data in Excel
December 30, 2023 - Inside the body tag, you will use the ‘record’ tag to define each row of your Excel file. ... Inside the ‘record’ tag you will use the column header names as an individual tag to store each cell’s contents. ... The following picture illustrates the structure of an XML document in a better way. You can copy the following piece of code to start creating your own schema.
🌐
YouTube
youtube.com › watch
How to Create XML Mapping in Excel - YouTube
In this video, I'll guide you through three methods to create XML mapping in Excel. You'll learn about choosing XML files, mapping XML into an Excel file, an...
Published   December 2, 2023