@Test
public void removeTranslationFromElement() throws Exception {

    Element multilingualElement = Xml.loadFile(this.getClass().getClassLoader().getResource("schema/iso19139/multilingual-contact.xml"));
    ISO19139SchemaPlugin plugin = new ISO19139SchemaPlugin();
    plugin.removeTranslationFromElement(multilingualElement, Arrays.asList(new String[]{"#EN"}));
    String resultString = Xml.getString(multilingualElement);
    assertThat(
            resultString, hasXPath("count(//gmd:PT_FreeText)", equalTo("0")).withNamespaceContext(ns)
    );
    assertThat(
            resultString, hasXPath("count(//gco:CharacterString[text() = 'Name (multilingual)'])",
                    equalTo("0")).withNamespaceContext(ns)
    );
    assertThat(
            resultString, hasXPath("count(//gco:CharacterString[text() = 'en-individualname'])",
                    equalTo("1")).withNamespaceContext(ns)
    );
}