Add document identifiers to serialization