Alternate XML by using FileHandler
import java.util.logging.FileHandler; import java.util.logging.Level; import java.util.logging.Logger; public class Main { public static void main(String[] argv) throws Exception { FileHandler handler = new FileHandler("alterxml.xml"); Logger logger = Logger.getLogger("your.logging"); logger.addHandler(handler); logger.log(Level.INFO, "alternative xml"); } }