docs: def _check_doc(self, root):
          """Validates the xml tree and returns the published date"""
          if (root.tag != 'ISO_4217' or
              root[0].tag != 'CcyTbl' or
              root[0][0].tag != 'CcyNtry' or
              not root.attrib['Pblshd'] or
              # Actual length in Oct 2016: 279
              len(root[0]) < 270):
  
              raise TypeError("%s: XML %s appears to be invalid" % (self.name, self._cached_currency_file))
  
          return datetime.strptime(root.attrib['Pblshd'], '%Y-%m-%d').date()