Help for this page
use strict; use warnings; ... $doc->documentElement->appendChild($doc->createElementNS($ns, 'q:two') +); $doc->documentElement->appendChild($doc->createElementNS($ns, 'q:three +')); warn $doc->toString(1);
<?xml version="1.0"?> <q:one xmlns:q="http://www.example.com"> <q:two xmlns:q="http://www.example.com"/> <q:three xmlns:q="http://www.example.com"/> </q:one>