code: public static void convert(File infile, File xslfile, File outfile) {
  		try {
  			// Create transformer factory
  			TransformerFactory factory = TransformerFactory.newInstance();
  
  			// Use the factory to create a template containing the xsl file
  			Templates template = factory.newTemplates(new StreamSource(
  					new FileInputStream(xslfile)));
  
  			// Use the template to create a transformer
  			Transformer xformer = template.newTransformer();
  			
  			// passing 2 parameters
  			String branch = outfile.getParentFile().getCanonicalPath().substring(root.length());
  			branch = branch.replace(File.separatorChar, '/');
  			StringBuffer path = new StringBuffer();
  			for (int i = 0; i < branch.length(); i++) {
  				if (branch.charAt(i) == '/') path.append("/..");
  			}
  			
  			xformer.setParameter("branch", branch);
  			xformer.setParameter("root", path.toString());
  
  			// Prepare the input and output files
  			Source source = new StreamSource(new FileInputStream(infile));
  			Result result = new StreamResult(new FileOutputStream(outfile));
  
  			// Apply the xsl file to the source file and write the result to the
  			// output file
  			xformer.transform(source, result);
  		} catch (Exception e) {
  			e.printStackTrace();
  		}
  	}
docs: Converts an <code>infile</code>, using an <code>xslfile</code> to an
  <code>outfile</code>.
  
  @param infile
  the path to an XML file
  @param xslfile
  the path to the XSL file
  @param outfile
  the path for the output file