code: private List<URL> findORMResources(PersistenceUnitInfo pui, String ormFileName) throws IOException {
          final boolean isMetaInfoOrmXML = "META-INF/orm.xml".equals(ormFileName);
          final ArrayList<URL> retArr = new ArrayList<URL>();
  
          Enumeration<URL> ormEnum = pui.getClassLoader().getResources(ormFileName);
          while (ormEnum.hasMoreElements()) {
              final URL url = ormEnum.nextElement();
              final String urlExtern = url.toExternalForm(); //  ParserUtils.decode(url.toExternalForm());
  
              if (!isMetaInfoOrmXML) {
                  // If it's not "META-INF/orm.xml", then the mapping files may be present anywhere in the classpath.
                  retArr.add(url);
                  continue;
              }
  
              // Check against persistence unit root
              if (urlExtern.startsWith(pui.getPersistenceUnitRootUrl().toExternalForm())) {
                  retArr.add(url);
                  continue;
              }
  
              // Check against Jar files, if any
              for (URL jarUrl : pui.getJarFileUrls()) {
                  final String jarExtern = jarUrl.toExternalForm();
                  if (urlExtern.startsWith(jarExtern)) {
                      retArr.add(url);
                      continue;
                  }
              }
          }
  
          return retArr;
      }
docs: Finds all specified ORM files, by name, constrained in location by the persistence unit root and jar files.
  
  @param ormFileName The name of the ORM file to search for
  @return A List of URLs of resources found by the ClassLoader. Will be an empty List if none are found.
  @throws IOException