Add "type" attribute to Elements