private static void filterWebXml(WebArchive webArchive, File explodedWarFile) {
try {
SAXReader reader = new SAXReader();
Document document = reader.read(new File(explodedWarFile.getPath() + "/WEB-INF/web.xml"));
// Keep in sync with guvnor-distribution-wars/src/main/config-processor-filter/jboss-as-7_0/web_xml-filter.xml
DefaultXPath xpath = new DefaultXPath("//j:context-param[j:param-name/text()=\"resteasy.injector.factory\"]");
Map<String,String> namespaces = new TreeMap<String,String>();
namespaces.put("j","http://java.sun.com/xml/ns/javaee");
xpath.setNamespaceURIs(namespaces);
Node node = xpath.selectSingleNode(document);
node.detach();
File filteredWebXml = new File("target/test/filtered/jboss-as-7_0/WEB-INF/web.xml");
filteredWebXml.getParentFile().mkdirs();
FileWriter writer = null;
try {