def METHOD_NAME(path, registry, resource_name):
    """Try to load the named resource using the given directory
    and registry.
    Returns the resource data and mimetype as a pair.
    """
    resource = registry.find('file[@name=%s]' % quoteattr(resource_name))
    if resource is None: return None
    pathname = os.path.join(path, resource.attrib['file'])
    try:
        return (open(pathname).read(), resource.attrib['mimetype'])
    except IOError as e:
        if e.errno == errno.ENOENT: return None
        else: raise