added and tested SerializeAsTextAttribute