xsd2py: add indentation for clarity
xsd2py: fix output of generated code when using Python 3
wsdl2py: refactor output of generated code by removing duplicated lines
wsdl2py: fix rendering of imported schemas when using Python 3
wsdl2py: add blank line at the end of the template

sys.stdout.buffer.write does not add an extra newline but
print() does so we need to include this in the template
sha512 is overkill if we just want to generate a reasonably unique identifier in xsd code generation

md5 is a bit faster and we don't have any security requirements here.