Added a simple atomic counter for periodic re-instantiation of XmlInputFactory.
Make it work with Java 7.

Added an atomic counter for periodic re-instantiation of
XmlInputFactory.