public static Configuration fromXml(@NotNull String xml) throws JDOMException {
    xml = xml.trim();
    final Configuration configuration;
    if (xml.startsWith("<searchConfiguration ") && xml.endsWith("</searchConfiguration>")) {
      configuration = new SearchConfiguration();
    }
    else if (xml.startsWith("<replaceConfiguration ") && xml.endsWith("</replaceConfiguration>")) {
      configuration = new ReplaceConfiguration();
    }
    else {
      return null;
    }
    try {
      final Element element = JDOMUtil.load(xml);
      configuration.readExternal(element);
      return configuration;
    }
    catch (IOException ignored) {
      // can't happen
      return null;
    }
  }
public static Configuration fromXml(@NotNull String xml)