To convert the data into xls file you can use Jakarta POI.(http://jakarta.apache.org/poi/index.html).And for xml file check this out http://xml.apache.org/Both have examples and easy to understand.