int value;
try {
String text = element.getText();
value = Integer.parseInt(text, text.startsWith("0") ? 8 : 10);
} catch (NumberFormatException e) {
throw new IncorrectOperationException("Invalid integer");
}
final String result = "0x" + Integer.toString(value, 16);
final int start = element.getTextOffset();
final int end = start + element.getTextLength();