This does not seem to be part of dom
The XML declaration does not get its own node, but the properties declared in it are visible in the object Document:
>>> doc= minidom.parseString('<?xml version="1.0" encoding="utf-8" standalone="yes"?><a/>')
>>> doc.encoding
'utf-8'
>>> doc.standalone
True
standalone="yes", toxml() . , , , toxml() - promises XML . (, encoding, .)
:
xml= []
xml.append('<?xml version="1.0" encoding="utf-8" standalone="yes"?>')
for child in doc.childNodes:
xml.append(child.toxml())
XML ? , DOCTYPE, , . XML: " , ". , .