Conversion of data to xml format for dhtmlxgrid/dhtmxtree

we are using dhtmlxgrid/dhmtlxtreegid ,so i am thinking of writing a java class for converting data to xml format in which dhtmlxgrid expects. Can you please let me know is there any utility class available for doing that ,what are best practices involved ,does it a good idea to use xml schema for validating , is there any availabe schema for doing this?

XSD files for grid and treegrid attached (1.51 KB)