ItemType itemType = ((SaxonXQItemType)type).getSaxonItemType();
if (!itemType.isAtomicType()) {
throw new XQException("Target type is not atomic");
}
AtomicType at = (AtomicType)itemType;
if (!at.matchesItem(value, true, getConfiguration())) {
throw new XQException("value is invalid for specified type");
}
}