@Override
  @NotNull
  public XPathType getType() {
    final XPathFunction f = resolve();
    if (f == null) return XPathType.UNKNOWN;
    final Function function = f.getDeclaration();
    return function != null ? function.getReturnType() : XPathType.UNKNOWN;
  }
@Override
  @NotNull
  public XPathType getType()