I have a Directory structure with XML files. I am having an XSLT 1.0 which I am applying on all these files and generating new XML files for each. I had written code in JAVA. But my problem is I am not able to put output files at a separate output folder having same structure as one from which I am taking my input XML file. For Example if I have a root directory Home with two folders Folder1 and Folder2. Each Folder1 & Folder2 has number of XML files. So when I convert my XML files present in these folders so the output files so generated should go in separate folder having same structure.Here is the Java code:\[code\]import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.iutputStream;import javax.xml.transform.Source;import javax.xml.transform.Transformer;import javax.xml.transform.TransformerConfigurationException;import javax.xml.transform.TransformerException;import javax.xml.transform.TransformerFactory;import javax.xml.transform.stream.StreamResult;import javax.xml.transform.stream.StreamSource;public class XMLwithXSLT { public static void main(String[] args) throws FileNotFoundException, TransformerConfigurationException, TransformerException { File dir = new File("Input Directory Root Path Here"); listFilesInDirectory(dir); } public static void listFilesInDirectory(File dir) throws FileNotFoundException, TransformerException { File[] files = dir.listFiles(); if (files != null) { for (File f : files) { if (f.isDirectory()) { System.out.println(f.getName()); listFilesInDirectory(f); } else { System.out.println(f.getName()); OutputXml(f); } } } public static void OutputXml(File in) throws FileNotFoundException, TransformerException{ TransformerFactory tFactory = TransformerFactory.newInstance(); Source xslDoc = new StreamSource("backup.xslt"); Source xmlDoc = new StreamSource(in.getPath()) ; System.out.print(in.getName() + "/n"); String outputFileName = in.getName(); System.out.print(outputFileName ); OutputStream htmlFile; htmlFile = new FileOutputStream(outputFileName); Transformer transformer = tFactory.newTransformer(xslDoc); transformer.transform(xmlDoc, new StreamResult(htmlFile)); } } \[/code\]So can anyone help me as how I can specify the output path for the generated new file? Also how I can generate a output files in the same directory format as input?