Document: Avoid keeping the dom.Document around so long.