Reddy,
I generate an XML file from a
String. This is slightly different from your situation but I hope it'll give you some ideas.
My code is
String xmlString = ("hope this works");
try
{
String thisFile = new String(req.getParameter("fileName") + ".xml");
OutputStreamWriter oos = new OutputStreamWriter (new FileOutputStream(thisFile));
oos.write (xmlString);
oos.close();
oos = null;
thisFile=null;
}
catch (IOException ioe)
{
System.out.println("IO error: " + ioe);
}
This should generate a file with the name of the fileName request parameter with the xml extension. The text in the file will be the contents of the String xmlString.
Frank