<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def xmlinfo(self, id):
 """Return the XML info record for the given item"""

    self._update_index()
    for package in self._index.findall('packages/package'):
      if package.get('id') == id:
        return package
    for collection in self._index.findall('collections/collection'):
      if collection.get('id') == id:
        return collection
    raise ValueError('Package %r not found in index' % id)