def apply_filtering(tag, text):
    """Alter certain metadata elements according to the specified rules."""
    if tag == 'PubNumber':
        return text + '.pdf' 
    elif tag == 'Keyword':
        return text.title()
    elif tag == 'DegreeCode':
        if text == "Ph.D.":
            return "Dissertation"
    else:
        return text