'Convenience method to either return the first XML element with the
specified name or create it under the opf:package element and then
return it, if it does not already exist.'

def opf_get_or_create(self, name):

    ans = self.opf_xpath((u'//opf:' + name))
    if ans:
        return ans[0]
    self.dirty(self.opf_name)
    package = self.opf_xpath(u'//opf:package')[0]
    item = package.makeelement(OPF(name))
    item.tail = u'\n'
    package.append(item)
    return item
