p = tree.xpath('/pkg:package/pkg:metadata', namespaces=ns)[0]
res = {}
for s in ['title', 'language', 'creator', 'date', 'identifier']:
    res[s] = p.xpath('dc:%s/text()' % s, namespaces=ns)[0]
return res
Python library to extract 'epub' information