Cita:  
					Iniciado por caricatos  
  Hola:
 
¿Te fijaste si el xml está bien formado?, es cuestión de abrirlo simplemente con el navegador, me suena que le falta la etiqueta que contenga todo... 
<?php 
   header('Content-Type: text/xml');
    echo "<?xml version=\"1.0\"?>
<respuesta><var>".$_POST['var']."</var><c2>".$_POST['c2']."</c2>
</respuesta>"; 
?> 
Una referencia: 
Ajax, con X de XML. 
Saludos 

   
HERMANO ERA LO QUE DIJISTE GENIAL   
ESTO QUEDO ASI       
Código PHP:
Ver original- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
- <html xmlns="http://www.w3.org/1999/xhtml"> 
- <head> 
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
- <- title >- Documento  sin-  t &- iacute ;- tulo </- title >
 
- <script type="text/javascript"> 
- function requerir(){ 
-     try{ 
-     req=new XMLHttpRequest(); 
-     }catch(err1){ 
-         try{ 
-         req=new ActiveXObject("Microsoft.XMLHTTP"); 
-         }catch(err2){ 
-             try{ 
-             req=new ActiveXObject("Msxml2.XMLHTTP"); 
-             }catch(err3){ 
-             req= false; 
-             } 
-         } 
-     } 
- return req; 
- } 
- var peticion=requerir(); 
-   
- function llamarAjax(){ 
- var aleatorio=parseInt(Math.random()*999999999); 
- var campo=document.form1.apellido.value; 
- var campo2=document.form1.nombre.value; 
- var url="codigo.php?var="+campo+"&r="+aleatorio+"&c2="+campo2; 
- peticion.open("GET",url,true); 
- peticion.onreadystatechange =respuestaAjax; 
- peticion.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
- peticion.send(null); 
- } 
-   
- function respuestaAjax(){ 
-     if(peticion.readyState==4) 
-     { 
-         if(peticion.status==200) 
-         { 
-         //alert(peticion.responseText); 
-          
-        
-         var dina =  peticion.responseXML.getElementsByTagName("var")[0]; 
-         var apellidoDiv=  peticion.responseXML.getElementsByTagName("c2")[0]; 
-   
-            document.getElementById("dina").innerHTML=dina.childNodes[0].nodeValue;  
-            document.getElementById("apellidoDiv").innerHTML=apellidoDiv.childNodes[0].nodeValue;  
-         } 
-         else 
-         { 
-         alert("ha ocurrido un error"+peticion.statusText); 
-         } 
-     } 
-     else 
-     { 
-     document.getElementById("dina").innerHTML='<img src="carga.gif" />'; 
-     } 
- } 
-   
-   
- </script> 
- </head> 
- <body> 
- <div id="dina"></div> 
- <form action="" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1"> 
- <label> 
- <input type="text" name="nombre" id="nombre" /> 
- <div id="dina"></div><!--aqui quiero traer de la pagina solo la variable  $_GET['var']; --> 
- </label> 
- <label> 
- <input type="text" name="apellido" id="apellido" /> 
- <div id="apellidoDiv"></div> <!--aqui quiero traer de la pagina solo la variable  $_GET['c2'];--> 
- </label> 
-   
- <input name="" type="button" onclick="llamarAjax()" /> 
- </form> 
- </body> 
-   
- </html> 
Código PHP:
Ver original- <?php 
-   
- header('Content-Type: text/xml'); 
- echo "<?xml version=\"1.0\"?><respuesta><var>".$_GET['var']."</var><c2>".$_GET['c2']."</c2></respuesta>"; 
-   
- ?> 
FUNCIONA DE MARAVILLA  GENIOS POR FIN ESTO ES MUY PADRE