import re


def detectMetadataFormat(xmldoc):
    """ Detect the format of the metadata in `xmldoc`.

    """

    root = xmldoc

    if re.search("eml$", root.tag):
        return "eml"
    elif re.search("Dryad", root.tag):
        return "dryad"
    elif re.search("metadata", root.tag):
        return "fgdc"
    else:
        return "unknown"