stringXmlToHD

public static void stringXmlToHD2(String xml, String rutaFicheroDestino) throws IOException{
ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("utf-8"));

int BUFFER_SIZE = 1024;
FileOutputStream out = new FileOutputStream(rutaFicheroDestino);
byte[] buffer= new byte[BUFFER_SIZE];
int r;
while ((r = is.read(buffer)) > -1 ) {
out.write(buffer, 0, r);
}
out.flush();
out.close();
}