Document validation