'Determines whether the file is the correct XML type.'

def sniff(self, filename):

    with open(filename, 'r') as contents:
        while True:
            line = contents.readline()
            if ((line is None) or (not line.startswith('<?'))):
                break
        pattern = ('^<(\\w*:)?%s' % self.root)
        return ((line is not None) and (re.match(pattern, line) is not None))
