Called to serialize the document's DOCTYPE by the root element.
The document type declaration must name the root element,
but the root element is only known when that element is serialized,
and not at the start of the document.
This method will check if it has not been called before (
#_started),
will serialize the document type declaration, and will serialize all
pre-root comments and PIs that were accumulated in the document
(see
#serializePreRoot). Pre-root will be serialized even if
this is not the first root element of the document.