What I really want to do is to enumerate all the persistence units (PUs) declared for an application. Since some answer in StackOverflow says such a service does not exist in JPA, the option seems to be parsing the persistence.xml file myself and get all the PUs declared there.
So, how to load the persistence.xml file?