function xmlTemplate(o){
	this.xml    = o.xml;
	this.xsl    = o.xsl;
	this.div    = o.div;
	this.onLoad = o.onLoad;
	if(!this.xml) { alert('XML não informado'); return false; }
	if(!this.xsl) { alert('XSL nao informado'); return false; }
	if(!this.div) { alert('Elemento não informado'); return false; }
	Ext.Ajax.request({
		url : this.xml,
		xsl : this.xsl,
		div : this.div,
		onLoad : this.onLoad,
		success : function(req,p){
			Ext.Ajax.request({
				url : p.xsl,
				xml : req.responseXML,
				div : p.div,
				onLoad : p.onLoad,
				success : function(req,p){
					this.obj = function(n){ return document.getElementById(n); }
					if(Ext.isIE){
						this.obj(p.div).innerHTML = p.xml.transformNode(req.responseXML);
					} else {
						var xsltProcessor = new XSLTProcessor();
						xsltProcessor.importStylesheet(req.responseXML);
						var result = xsltProcessor.transformToFragment(p.xml, document);						
						this.obj(p.div).innerHTML = '';
						this.obj(p.div).appendChild(result);
						if(Ext.isGecko){
							this.obj(p.div).style.display = 'none';
							var result = this.obj(p.div).innerHTML;
							do{ result = result.replace('&amp;','&'); } while ( eval(result.indexOf('&amp;'))>0 );
							do{ result = result.replace('&lt;','<'); } while ( eval(result.indexOf('&lt;'))>0 );
							do{ result = result.replace('&gt;','>'); } while ( eval(result.indexOf('&gt;'))>0 );
							this.obj(p.div).innerHTML = result;
							this.obj(p.div).style.display = '';
						}
					}
					if(p.onLoad) {
						var funcoes = p.onLoad.split(',');
						for(var i=0;i<funcoes.length;i++){
							eval(funcoes[i]+"()");
						}
					}
				}
			});
		}
	});
}