can't this be unless node.attributes.empty?