def METHOD_NAME(doc, outputFile):
  layoutNsUri = "http://www.sbml.org/sbml/level3/version1/layout/version1"
  layoutNs = LayoutPkgNamespaces(3, 1)
  renderNsUri = "http://www.sbml.org/sbml/level3/version1/render/version1"
  renderNs = RenderPkgNamespaces(3, 1)
  prop = ConversionProperties(SBMLNamespaces(3,1))
  prop.addOption('strict', False)
  prop.addOption('setLevelAndVersion', True)
  prop.addOption('ignorePackages', True)
  doc.convert(prop)
  docPlugin = doc.getPlugin("layout")
  if docPlugin is not None:
    docPlugin.setElementNamespace(layoutNsUri)
  doc.getSBMLNamespaces().removePackageNamespace(3, 1, "layout", 1)
  doc.getSBMLNamespaces().addPackageNamespace("layout", 1)
  rdocPlugin = doc.getPlugin("render")
  if rdocPlugin is not None:
    rdocPlugin.setElementNamespace(renderNsUri)
  doc.getSBMLNamespaces().removePackageNamespace(3, 1, "render", 1)
  doc.getSBMLNamespaces().addPackageNamespace("render", 1)
  writeSBMLToFile(doc, outputFile)