I would like to provide diagnostic information about what JAXP implementation is in use, and which JAR file it was loaded from.
One way to achieve this is to create
It depends, but generally no.
DocumentBuilderFactory.newInstance() will either return the implementation of DocumentBuilderFactory which is configured in the system property "javax.xml.parsers.DocumentBuilderFactory" or the JRE's default factory if the system property is not set. The default factory is most likely hard coded in the implementation of the newInstance method and not otherwise accessible.
If the system property is set, you could at least use the getResource method on the relevant class loader to get the URL, from which the class loader would load the corresponding class file. If it is from a jar file, you should be able to extract the file name (or source URL) from the jar: URL. Detailed package information should also be available if you manaully read the meta data files from the classpath.
If the system property is not set, I'm pretty sure that you have no way to get the information you are looking for without actually creating a new factory as you're already doing.