This method of the Document class retrieves the document type.
public final String getDocType();
Returns the name specified in the <!DOCTYPE> tag.