Convert Excel to XML using C# and VB.NET How To. Sample source codes below show XLS to XML file conversion in C Sharp and Visual Basic .NET using Spreadsheet SDK.
C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Bytescout.Spreadsheet;
namespace Converting_XLS_to_XML
{
   class Program
   {
       static void Main(string[] args)
       {
     Spreadsheet document = new Spreadsheet();
     document.LoadFromFile("SimpleReport.xls");
           // delete output file if exists already
           if (File.Exists("SimpleReport.xml")){
               File.Delete("SimpleReport.xml");
           }
     document.Workbook.Worksheets[0].SaveAsXML("SimpleReport.xml");
     document.Close();
       }
   }
}
VB.NET
Imports Bytescout.Spreadsheet
Imports System.IO
Module Module1
   Sub Main()
       Dim document As New Spreadsheet()
document.LoadFromFile("SimpleReport.xls")
       ' remove output file if already exists
       If File.Exists("Output.xml") Then
           File.Delete("Output.xml")
       End If
       ' Save document
       document.Workbook.Worksheets(0).SaveAsXML("Output.xml")
       ' Close Spreadsheet
       document.Close()
       ' open in default spreadsheets viewer/editor
       Process.Start("Output.xml")
       document.Close()
   End Sub
End Module