<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize_to_headers(self):
 """Serialize to a dict of HTTP headers. Used in responses to HTTP HEAD requests. As with regular HTTP GET requests, HEAD requests may return DataONE Exceptions. Since a response to a HEAD request cannot include a body, the error is returned as a set of HTTP headers instead of an XML document. """

        return {
            'DataONE-Exception-Name': self.__class__.__name__,
            'DataONE-Exception-ErrorCode': self._format_header(self.errorCode),
            'DataONE-Exception-DetailCode': self._format_header(self.detailCode),
            'DataONE-Exception-Description': self._format_header(self.description),
            'DataONE-Exception-TraceInformation': self._format_header(
                self.traceInformation
            ),
            'DataONE-Exception-Identifier': self._format_header(self.identifier),
            'DataONE-Exception-NodeID': self._format_header(self.nodeId),
        }