serialize id objects for elements