Remove empty attributes and elements from output