procedure ConvertToXML(sheetindex:Integer;xlsfile:String;outfile:String);
var
XLS:TXLSReadWriteII2;
col,row:integer;
ws:TStringList;
begin
XLS:=TXLSReadWriteII2.Create(nil);
XLS.Filename:=xlsfile;
XLS.Read;
ws:=TStringList.Create;
for row:=0 to XLS.Sheets[sheetindex].LastRow do
begin
for col:=0 to XLS.Sheets[sheetindex].LastCol do
begin
ws.Add(XLS.Sheets[sheetindex].AsWideString[col,row]);
end;
end;
ws.SaveToFile(outfile);
ws.Free();
end;