He creado un documento XML de la forma
Código PHP:
$PrUsxml = new DomDocument('1.0','UTF-8');
$Raiz= $PrUsxml->createElement('RAIZ');
$Raiz= $PrUsxml->appendChild($Raiz);
For ($Cont=0;$Cont<10;$Cont++)
{
$Registro = $PrUsxml->createElement('Registro');
$Registro = $Raiz->appendChild($Registro);
$RNombre = $PrUsxml->createElement('Nombre');
$RNombre = $Registro->appendChild($Nombre);
}
y despues guardar el archivo
Código PHP:
$PrUsxml->Registro[1]->Nombre ="Manuel";
$PrUsxml->Registro[2]->Nombre ="Marcos";
........................
...........................
Código PHP:
$PrUsxml->formatOutput = true;
$PrUsxml->saveXML();
$PrUsxml->save('//PrUsers.xml');
Gracias