def iter_fields(node):
    """Iterate over all fields of a node, only yielding existing fields."""
    for field in node._fields:
        try:
            yield field, getattr(node, field)
        except AttributeError:
            pass
