Map<String, String> prefixMap = new HashMap<String, String>();
prefixMap.put("edmx", "http://schemas.microsoft.com/ado/2007/06/edmx");
prefixMap.put("a", "http://schemas.microsoft.com/ado/2008/09/edm");
prefixMap.put("foo", "http://www.foo.bar/Protocols/Data");
NamespaceContext ctx = new SimpleNamespaceContext(prefixMap);
XMLUnit.setXpathNamespaceContext(ctx);
assertXpathExists("/edmx:Edmx/edmx:DataServices/a:Schema/foo:schemaElementTest1", metadata);
assertXpathExists("/edmx:Edmx/edmx:DataServices/a:Schema/foo:schemaElementTest1/foo:schemaElementTest2", metadata);
assertXpathExists("/edmx:Edmx/edmx:DataServices/a:Schema/foo:schemaElementTest1/foo:schemaElementTest3", metadata);