in reply to xml document preface
perl -MXML::LibXML -le 'print XML::LibXML->load_xml( string => "<root/ +>" )->serialize' <?xml version="1.0"?> <root/> [download]
Agreement there. The encoding needs to be included if it's anything past ASCII/encoded entities.