When i run the second time it takes relatively lesser time and in the subsequent calls it takes much more lesser time than the second run with almost consistent results thereafter. Not sure why there is inconsistency in the time taken for parsing the same input. One time creation of Xml Input Factory, (static method in the class level) No, that is the API class.
What is the implementation of that class -- check out "stream Class()".
Some maintain that because transformation should always be applied on inbound/outbound data, transformations should be available as part of the enterprise service bus instead of inside the components.
This approach matches the concepts of Aspect Oriented Programming (AOP).
The XML transformers are in the transformer package.