Makes sense. Assuming the declaration is at the top, is it sufficient in the case of a DTD, to check for "<!DOCTYPE root-element'? Or for a schema, to check that the path of the XML schema is in the schemaLocation attribute of the XML file root element, i.e. check for 'xsi:schemaLocation' or 'xsi:noschemalocation'?