def strip_attributes(node, preserve_attrs):
    """Strip unnecessary data attributes from node."""
    node_attrs = list(node[1].keys())
    for attr in node_attrs:
        if attr not in preserve_attrs:
            del node[1][attr]
    return node