public void save(){ String fileName = "prueba.xml"; try { OutputStream fout= new FileOutputStream(fileName); TransformerFactory transFactory = TransformerFactory.newInstance(); Transformer transformer = transFactory.newTransformer(); DOMSource source = new DOMSource(this.toXml()); StreamResult result = new StreamResult(fout); transformer.transform(source, result); } catch( Exception e ){ }; };