//--- Creo el contador "count" para generar el random
var count = 0;

function LeerXML(){
	
	//--- Recupero la cantidad de nodos en el XML
	count=xmlDoc.getElementsByTagName("comment").length;
	
	//--- Corremos la funcion para que muestre algo al inicio
	MostrarXML();
	
	//--- Despues se repetira cada 20 segundos.
	setInterval(MostrarXML,20000);
}

function MostrarXML(){
	//--- Generando el random
	var rand=Math.floor(Math.random()*(count));
	
	//--- Con en random creado lleno los elementos html dependiendo del campo
	document.getElementById("de").innerHTML='"'+xmlDoc.getElementsByTagName("from")[rand].childNodes[0].nodeValue+'"';
	document.getElementById("comentario").innerHTML=xmlDoc.getElementsByTagName("body")[rand].childNodes[0].nodeValue;
}