Java tutorial
//package com.java2s; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; public class Main { private static String filepath = Thread.currentThread().getContextClassLoader().getResource("process.xml") .getPath(); public static synchronized Document getDocument() throws Exception { // System.out.println(filepath); return DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(filepath); } }