def filter_instance(inst, plist):
    """Remove properties from an instance that aren't in the PropertyList

    inst -- The CIMInstance
    plist -- The property List, or None.  The list items must be all
        lowercase.

    """

    if plist is not None:
        for pname in inst.properties.keys():
            if pname.lower() not in plist:
                del inst.properties[pname]