code: public static XMLOutputFactory makeNewOutputFactory() {
      XMLOutputFactory factory = XMLOutputFactory.newInstance();
      factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
      return factory;
    }
docs: Returns a new {@link XMLOutputFactory}. This factory will have its
  {@link XMLOutputFactory#IS_REPAIRING_NAMESPACES} property set to {@code true}.
  <p>
  CAUTION: Creating XML factories is potentially a pretty expensive operation. If possible, consider using a shared
  instance ({@link #getOutputFactory()}) to amortize this initialization cost via reuse.
  
  @return  a namespace-repairing {@link XMLOutputFactory}
  
  @throws FactoryConfigurationError  see {@link XMLOutputFactory#newInstance()}
  
  @see #getOutputFactory()