<?php
session_name('excel_a_webservices');
session_start();
				function descargaXML() {

		if ($_SESSION['xmlreturn'] == "") { ?>
<script type="text/javascript">
alert("No existe factura con esos parámetros. ");
</script>
<?php
		} else {
			/*$sql = "SELECT response FROM ula_tabla WHERE id = '".$_SESSION['idResponse']."' ";
			$result = mysqli_query ($conn, $sql );
			$value = mysqli_fetch_assoc ( $result );
			$txt = ($value['response']);*/
			header ( 'Content-Description: File Transfer' );
			header ( 'Content-Type: text/xml, application/xml' );
			header ( 'Content-disposition: attachment; filename="'.$_SESSION['rfcEmisor'].'_'.$_SESSION['seriefolio'].'.xml" ' );
			header ( 'Expires: 0' );
			header ( 'Cache-Control: must-revalidate' );
			header ( 'Pragma: public' );
			echo $_SESSION['xmlreturn'];
		}
		return;
	} // Fin de descarga XML
	//$descargarXML =  isset($_GET['descargar'])?$_GET['descargar']:'';
	if($_GET['descargar']=='xml'){
	descargaXML ();
		}	else{echo 'sin parametros';}