I'm trying to make this xml using SimpleXMLElement:
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:etsi="http://uri.etsi.org/01903/v1.3.2#" Id="Signature620397"> $signature = $invoice->addChild('ds:Signature', null, 'http://www.w3.org/2000/09/xmldsig#'); $signature->addAttribute('xmlns:etsi', 'http://uri.etsi.org/01903/v1.3.2#'); $signature->addAttribute('Id', 'Signature620397'); Later in the xml i need to reference the etsi namespace, but i could not find a way
<etsi:QualifyingProperties Target="#Signature620397"> Is there anyway to do this? Or that would be the limitations of SimpleXMLElement
SimpleXMLElement, I suggest you giveDOMDocumenta whirl, instead. The API is much more consistent and well understood.