Location: PHPKode > scripts > XML-Writer > sample1.php
<?php

 require_once 'XMLFile.php';

    $x = new XMLFile();
      $x->open("./test1.xml");
      $x->writeHeader();
      $x->writeOpenTag('UTENTI','');
	        $x->writeOpenTag('UTENTI_SPECIALI','');
                    $x->writeElement('NOME','','Mario');
                    $x->writeElement('COGNOME','','Rossi');
                $x->writecloseTag('UTENTI_SPECIALI');
      $x->writecloseTag('UTENTI');
      $x->close();   


$xml_file = "test1.xml";

echo  file_get_contents($xml_file); 

/*
xml file

<?xml version="1.0" encoding="ISO-8859-1"?>
<UTENTI>
<UTENTI_SPECIALI>
<NOME>Mario</NOME>
<COGNOME>Rossi</COGNOME>
</UTENTI_SPECIALI>
</UTENTI>


*/ 
?> 
Return current item: XML-Writer