if (value.equals("0") || value.equals("false"))
String trimmed = trimWhitespace(value); if (trimmed.equals("0") || trimmed.equals("false"))
	public AtomicValue convertTo(int requiredType) throws XPathException {		switch (requiredType) {			case Type.ATOMIC :			case Type.ITEM :			case Type.STRING :				return this;			case Type.NORMALIZED_STRING:			case Type.TOKEN:			case Type.LANGUAGE:			case Type.NMTOKEN:			case Type.NAME:			case Type.NCNAME:			case Type.ID:			case Type.IDREF:			case Type.ENTITY:				return new StringValue(value, requiredType);			case Type.ANY_URI :				return new AnyURIValue(value);			case Type.BOOLEAN :				if (value.equals("0") || value.equals("false"))					return BooleanValue.FALSE;				else if (value.equals("1") || value.equals("true"))					return BooleanValue.TRUE;				else					throw new XPathException(						"cannot convert string '" + value + "' to boolean");			case Type.FLOAT :				return new FloatValue(value); 			case Type.DOUBLE :			case Type.NUMBER :				return new DoubleValue(this);			case Type.DECIMAL :				return new DecimalValue(value);			case Type.INTEGER :			case Type.NON_POSITIVE_INTEGER :			case Type.NEGATIVE_INTEGER :			case Type.POSITIVE_INTEGER :			case Type.LONG :			case Type.INT :			case Type.SHORT :			case Type.BYTE :			case Type.NON_NEGATIVE_INTEGER :			case Type.UNSIGNED_LONG :			case Type.UNSIGNED_INT :			case Type.UNSIGNED_SHORT :			case Type.UNSIGNED_BYTE :				return new IntegerValue(value, requiredType);			case Type.BASE64_BINARY :				return new Base64Binary(value);            case Type.HEX_BINARY :                return new HexBinary(value);			case Type.DATE_TIME :				return new DateTimeValue(value);			case Type.TIME :				return new TimeValue(value);			case Type.DATE :				return new DateValue(value);			case Type.DURATION :				return new DurationValue(value);			case Type.YEAR_MONTH_DURATION : 				return new YearMonthDurationValue(value);			case Type.DAY_TIME_DURATION :					return new DayTimeDurationValue(value);            case Type.GYEAR :                return new GYearValue(value);            case Type.GMONTH :                return new GMonthValue(value);            case Type.GDAY :                return new GDayValue(value);            case Type.GYEARMONTH :                return new GYearMonthValue(value);            case Type.GMONTHDAY :                return new GMonthDayValue(value);			case Type.UNTYPED_ATOMIC :				return new UntypedAtomicValue(getStringValue());			default :				throw new XPathException("FORG0001: cannot cast '" + 						Type.getTypeName(this.getItemType()) + "(\"" + getStringValue() + "\")' to " +						Type.getTypeName(requiredType));		}	}