def METHOD_NAME(fragment):
    """
    Remove potentially harmful attributes and elements from an HTML fragment.
    Currently, that means:
    - Each descendant element's tag must be in a whitelist of tags.
    - ``a`` tags with an ``href`` attribute must have their ``href`` URL's
      scheme in a whitelist of URL schemes. Additionally, links to non-Weasyl
      websites will have a ``rel="nofollow ugc"`` attribute added to the tag.
    - ``img`` tags with an ``src`` attribute must have their ``src`` URL's
      scheme in a whitelist of URL schemes.
    - Any element with a ``style`` attribute is only permitted a CSS ``color``
      declaration of a hex color value, and no other CSS properties.
    - Any element with a ``class`` attribute is only permitted classes in a
      whitelist of CSS classes.
    - Any attributes on an element not mentioned above must be in a whitelist
      of attribute names.
    Parameters:
        fragment: An lxml ``Element``.
    Returns:
        ``None``, as modification is done in-place on *fragment*.
    """
    unwrap = []
    for child in fragment:
        if child.tag not in allowed_tags:
            unwrap.append(child)
        extend_attributes = []
        for key, value in child.items():
            if key == "href" and child.tag == "a" and get_scheme(value) in allowed_schemes:
                url = urlparse(value)
                if url.hostname not in (None, "www.weasyl.com", "weasyl.com"):
                    extend_attributes.append(("rel", "nofollow ugc"))
            elif key == "src" and child.tag == "img" and get_scheme(value) in allowed_schemes:
                pass
            elif key == "style" and ALLOWED_STYLE.match(value):
                pass
            elif key == "class":
                child.set("class", " ".join(set(value.split()) & allowed_classes))
            elif key not in allowed_attributes:
                del child.attrib[key]
        for key, value in extend_attributes:
            child.set(key, value)
        METHOD_NAME(child)
    for child in unwrap:
        child.drop_tag()