'Initialize the output file.'

def initialize_export(self, filename, bulkload_state):

    self.bulkload_state = bulkload_state
    if (not self.node_list):
        raise bulkloader_errors.InvalidConfiguration('simplexml    export    only    supports    simple    /root/to/node    xpath_to_nodes    for    now.')
    self.output_stream = codecs.open(filename, 'wb', 'utf-8')
    self.output_stream.write('<?xml    version="1.0"?>\n')
    self.depth = 0
    for node in self.node_list:
        self.output_stream.write(('%s<%s>\n' % (('    ' * self.depth), node)))
        self.depth += 1
    self.indent = ('    ' * self.depth)
