JCR2SPI returns an import handler which delegates work to a SAXTransformerHandler. In JDK, that one has a known issue not processing namespace prefix mappings properly (will attach a separate test case).
- drop JDK 1.4 support
- tune the JCR2SPI handler to create namespace attributes when needed
- use an entirely different serializer
My personal preference would be just to drop JDK 1.4 support, but that may not be acceptable for everyone.