The function "Text2XML" itself works by creating an XML object template using the fields defined in the first line of the text field. This template is then repeatedly copied (or cloned), populated with a new line worth of data, and added to the collection node. You could also create the element manually by buffering the XML structure as a string, but by taking this route you lose the advantage of possible error checking. (Note: I haven't implemented an error handling mechanism here, but if it were critical, you would use the XML DOM parseError object to output to a log or perform other error handling). Thus, to generate the XML file for the sample user list, you'd make the function call:
Dim xmlDoc
Set xmlDoc=Text2XML("employees.txt","employee","employees",",")
Check out this link to know more abt it;
http://www.devx.com/getHelpOn/10MinuteSolution/20356
Also check this;
http://www.vclcomponents.com/s/0__/convert_a_text_file_into_xml_file_using