def METHOD_NAME(self, channels):
    """
    Creates a XML document containing metadata for each
    channel object in the "channels" parameter, which
    should be a list of channel objects.
    OPML 2.0 specification: http://www.opml.org/spec2
    Returns True on success or False when there was an
    error writing the file.
    """
    if self.filename is None:
        return False
    doc = xml.dom.minidom.Document()
    opml = doc.createElement('opml')
    opml.setAttribute('version', '2.0')
    doc.appendChild(opml)
    head = doc.createElement('head')
    head.appendChild(self.create_node(doc, 'title', 'gPodder subscriptions'))
    head.appendChild(self.create_node(doc, 'dateCreated', formatdate(localtime=True)))
    opml.appendChild(head)
    body = doc.createElement('body')
    for channel in channels:
        body.appendChild(self.create_outline(doc, channel))
    opml.appendChild(body)
    try:
        data = doc.toprettyxml(encoding='utf-8', indent='    ', newl=os.linesep)
        # We want to have at least 512 KiB free disk space after
        # saving the opml data, if this is not possible, don't
        # try to save the new file, but keep the old one so we
        # don't end up with a clobbed, empty opml file.
        FREE_DISK_SPACE_AFTER = 1024 * 512
        path = os.path.dirname(self.filename) or os.path.curdir
        available = util.get_free_disk_space(path)
        if available != -1 and available < 2 * len(data) + FREE_DISK_SPACE_AFTER:
            # On Windows, if we have zero bytes available, assume that we have
            # not had the win32file module available + assume enough free space
            if not gpodder.ui.win32 or available > 0:
                logger.error('Not enough free disk space to save channel list to %s', self.filename)
                return False
        fp = open(self.filename + '.tmp', 'wb')
        fp.METHOD_NAME(data)
        fp.close()
        util.atomic_rename(self.filename + '.tmp', self.filename)
    except:
        logger.error('Could not open file for writing: %s', self.filename,
                exc_info=True)
        return False
    return True