Removing empty attributes from generated code