Posted to tcl by evilotto at Wed Jul 23 23:48:21 GMT 2014view pretty
package require tdom set u urn:foo dom createDocumentNS $u Foo foo $foo createElementNS $u Bar bar $foo createElementNS $u Baz baz # swap the next 2 lines and the extra namespace declaration disappears $bar appendChild $baz [$foo documentElement] appendChild $bar puts [$foo asXML -indent 4]