working document serialization -- pass 1