InputStream xmlPath = this.getClass().getResourceAsStream("/META-INF/persistence.xml");
//用得dom来解析该XML文件
DocumentBuilderFactory domfac=DocumentBuilderFactory.newInstance();
DocumentBuilder dombuilder=domfac.newDocumentBuilder();
Document doc = dombuilder.parse(xmlPath);
Element root=doc.getDocumentElement();
NodeList persistence_unit =root.getChildNodes();
...............