code: def get_pubmed_xml(self):
          
          url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/' \
                'efetch.fcgi?db=pubmed&rettype=abstract&id={}' \
                .format(self.pmid)
  
          try:
              response = urlopen(url)
          except URLError:
              xml_dict = ''
          else:
              xml = response.read().decode()
              xml_dict = xmltodict.parse(xml)
  
          return xml_dict
docs: Use a PubMed ID to retrieve PubMed metadata in XML form.