int result;
if (_value != Integer.MIN_VALUE) {
result = _value;
}
else {
int next = _node;
final int root = _document.getDocument();
result = 0;
while (next >= root && !matchesFrom(next)) {
if (matchesCount(next)) {
++result;
}
next--;
//%HZ%: Is this the best way of finding the root? Is it better to check
//%HZ%: parent(next)?
/*
if (next == root) {
break;
}
else {
--next;
}
*/
}
}
return formatNumbers(result);