class ElementProperties {

    public static ElementProperty withIndexInRange(int first, int last) {
        return new ElementProperty() {
            @Override
            public String toXpath() {
                return String.format("position()>=%d and position()<=%d", first + 1, last + 1);
            }

            public String toString() {
                return String.format("with index from %d to %d", first, last);
            }
        };
    }

    private  ElementProperties();

}