Converting CSV into Usable XML

I have a csv file that contains a tree menu hierarchy in each column. Column 1 contains the level 1 values of the tree, Column 2 contains the level 2 values of the tree, etc. How can I convert this data into the proper format need to use the dhtmlxtree sytanx?

For instance,

There is no built in support for such format of CSV data, probably you can use some kind of server side script to convert CSV to supported format. Details of implementation may be specific based on used server side language