Apparently, Sun decided to change the semantics of BigDecimal.toString() with the release of Java 5.0, allowing scientific notation to be 'produced' when calculating the String representation of a BigDecimal instance. With Java 5.0, BigDecimal.toString() can return a String in scientific notation. As we use a BigDecimal for the XML schema type <xs:decimal>, this is illegal (as per XML schema specification, this is not allowed).
As a result of this, BigDecimal.toPlainString() should be used for Java 5.0 and above (ideally for BigDecimals representing ,xs>decimal> only). It looks like the code in question (within Marshaller) will have to take into account the JVM release number to make an educated decision.