Very close:

select 
  T.X.value('./kind[1]', 'nvarchar(50)') as kind,
  T.X.value('./sortid[1]', 'int') as sortid
from @out.nodes('/row') as T(X);


how to convert xml to database table
I am able to import my .csv file using Apex Data Loader. When I try importing the same file from CLI I am getting an exception attached in the file.
When the file contents are copied into a new csv file and try importing this new .csv file, this succeeds.
Also If I open my .csv file, click on save, a pop-up comes up "MyFile.csv may contain features that are not compatible with CSV(Comma Delimited).
Do you want to keep the workbook in this format? " And if I click on "Yes" or "No"and close the file without saving it and then try to upload the same file. 
The data gets uploaded.
This is something weird and I am not able to get any logic out of it..

This is the error msg i am getting.

