This method returns a reference to the specific SimpleXMLElement.If you use:<?php $xml= new SimpleXMLElement('<root></root>');$xml->father['name']= 'Fathers name'; // creates automatically a father tag with attribute name$son= $xml->father->addChild('son'); // uses the first father tag$son['name']= 'first son';$otherSon= $xml->father->addChild('son'); // uses the first father tag but now, in a second son tag$otherSon['name']= 'second son';