This pull request is useful but unless you are printing to the console this line needs to get changed. Pass the parameters from the parent constructor rather than resetting them to None and iso-8859-1. In other words...

    XMLGenerator.__init__(self, out=out, encoding=out)