write out structs with structs as attributes