You want to add empty children and then set the "nome" attributes for
each child.
So maybe something like this:
<?php
$list = array( "jim", "susan", "henry" );
$p = new SimpleXMLElement( '<people></people>' );
foreach ( $list as $k => $d ) {
$c = $p->addChild( 'person' );
$c->addAttribute( 'name', $d );
}
echo $p->asXML();
?>
Output:
<?xml version="1.0"?>
<people><person name="jim"/><person name="susan"/><person name="henry"/></
people>
Rgds
Denis McMahon