Parsing each document only once