Working with document type