'Dump the contents of the database to an XML .plist file.
The file can be passed as either a file object or a pathname.
All data, including included databases, is dumped.'

def dump(self, pathOrFile):

    packages = []
    for pkg in self._packages:
        packages.append(pkg.dump())
    plistdata = {'Version': self._version, 'Maintainer': self._maintainer, 'Description': self._description, 'Packages': packages}
    plist = plistlib.Plist(**plistdata)
    plist.write(pathOrFile)
