@Test
public void testGetXPathExpr() throws Exception {

    final Element charString = TEST_METADATA.getChild("fileIdentifier", GMD).getChild("CharacterString", GCO);
    String xpath = Xml.getXPathExpr(charString);
    assertEquals("gmd:fileIdentifier/gco:CharacterString[normalize-space(text())='fileIdentifier']", xpath.replaceAll("\\s+", ""));
    assertSame(charString, Xml.selectElement(TEST_METADATA, xpath, NAMESPACES));
}