<?php
	class XML
	{		
		var $buffer;
		
		function XML(){
			$this->Inicializar();
		}
		
		function Inicializar(){
		 $this->AgregarVersion();
		}
		
		function AgregarVersion( $version = "1.0", $encoding = "utf-8" )
		{
			$this->buffer = '<?xml version="' . $version . '" encoding="' . $encoding. '" ?>';
			
		}
		
		function AgregarItem($nodo,$Valor){
			$this->AgregarNodo($nodo);
			$this->buffer .= $Valor;
			$this->CerrarNodo($nodo);
		}
		function AgregarItemConatributos($nodo,$Valor,$Atributos){
			$this->AgregarNodoConAtributos($nodo,$Atributos);
			$this->buffer .= $Valor;
			$this->CerrarNodo($nodo);
		}				

		
		function AgregarNodo($nodo){
			$this->buffer .= "<$nodo>";
		}
		function AgregarNodoConAtributos($nodo,$Atributos){
			$this->buffer .= "<$nodo ". $Atributos .">" ;
		}
		
		function CerrarNodo($nodo){
			$this->buffer .= "</".$nodo.">";
		}
		
		function GetXML(){
			return  $this->buffer;
		}
		
	}

?>
