added a comment - - edited
This bug is a big problem and repeatably kills other servlets. Everything seems to work at first, until GeoServer receives a WFS request with outputformat=GML2 or version=1.0.0, which triggers the system property change, and causes any other servlet relying on the platform TransformerFactory and not having a xalan jar to fail.
The fault is now at line 181-182 in org.geoserver.wfs.xml.GML2OutputFormat.prepare() on trunk.
You just cannot do this sort of thing in a servlet and expect to coexist with other servlets. It kills deegree running in the same Tomcat stone dead, because deegree was expecting to use the JDK 1.5 xalan (Sun's repackaged copy), and GeoServer just told everyone to use xalan 2.7.0, which it has, but nobody else has on their classpath. Anyone servlet using another TransformerFactory, such as Sun's repackaged copy of Xalan, or Saxon, is stuffed.
The workaround is to copy GeoServer's xalan jar into every other TransformerFactory-using servlet, so they can survive the property change.
There is one sane alternative: use SPI:
The third option is to use an SPI resource:
This looks like the only servlet-friendly option.