Let's Create a XML file of 'StudentData.xml' by just copy paste below text in it or You can download the 'StudentData.xml' file which i have attached here.
- <?xml version="1.0" encoding="UTF-8"?>
-
- <Student>
- <MyData>
- <RollNo>10</RollNo>
- <StudName>Sandeep Singh</StudName>
- <StudClass>A+</StudClass>
- </MyData>
- <MyData>
- <RollNo>11</RollNo>
- <StudName>Ankur Mistry</StudName>
- <StudClass>A</StudClass>
- </MyData>
- <MyData>
- <RollNo>12</RollNo>
- <StudName>Rohan Shah</StudName>
- <StudClass>A+</StudClass>
- </MyData>
- <MyData>
- <RollNo>13</RollNo>
- <StudName>Rahul Lad</StudName>
- <StudClass>A</StudClass>
- </MyData>
- <MyData>
- <RollNo>14</RollNo>
- <StudName>Rushabh Parekh</StudName>
- <StudClass>A</StudClass>
- </MyData>
- <MyData>
- <RollNo>15</RollNo>
- <StudName>Sonal Shah</StudName>
- <StudClass>A</StudClass>
- </MyData>
-
- </Student>
Step 1: Open your Microsoft Excel 2013 and open a blank workbook.
Click on Data Tab, Select From Other Sources -> From XML Data Import, Shown as per below Screen.
Step 2: Select the StudentData.xml from your PC.
Step 3: Next, it will ask Where do you want to put data? here you can map your columns and where you want to place it, for now just click 'Ok'
![]()
It will display the XML Data in your excel file. just save the data.
If you note here all your tag like '<RollNo>' or '<StudentName>' became Headers in Excel Spreadsheet.
That's it, Hope you like 3 simple steps to convert data from XML to Excel.