When parsing XML/HTML documents the corresponding document type (:html or :xml) is stored in Document#type.