Index: nmap.cc =================================================================== --- nmap.cc (revision 33388) +++ nmap.cc (working copy) @@ -1748,7 +1748,6 @@ chomp(mytime); char *xslfname = o.XSLStyleSheet(); xml_start_document(); - log_write(LOG_XML, "\n", NMAP_XMLOUTPUTVERSION); if (xslfname) { xml_open_pi("xml-stylesheet"); xml_attribute("href", "%s", xslfname); Index: xml.cc =================================================================== --- xml.cc (revision 33388) +++ xml.cc (working copy) @@ -320,6 +320,8 @@ if (xml_newline() < 0) return -1; + log_write(LOG_XML, "\n", NMAP_XMLOUTPUTVERSION); + return 0; }