How can I see if a document is valid?