 var xmlDoc = null;

 function init() 
 {
  if (document.all && document.getElementById)
  {
   xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
   xmlDoc.async = false;
   xmlDoc.load(xmlSource);
   showXML();
  }
  else
   if (document.implementation && document.implementation.createDocument)
   {
    xmlDoc = document.implementation.createDocument("", "", null);
    xmlDoc.addEventListener('load', showXML, false);
    xmlDoc.load(xmlSource, "text/xml");
   }
 } 

 function togli_vuoti(xml_tag) 
 {
  var notWhitespace = /\S/;

  for (i = 0; i < xml_tag.childNodes.length; i++)
   if ((xml_tag.childNodes[i].nodeType == 3) && (!notWhitespace.test(xml_tag.childNodes[i].nodeValue)))
   {
    xml_tag.removeChild(xml_tag.childNodes[i]);
    i--;
   }
   
  return  xml_tag;
 }