result = new DecimalValue(Double.toString(duration.getSeconds()));
result = new DecimalValue(duration.getCanonicalDuration().getField(DatatypeConstants.SECONDS).doubleValue() * duration.getCanonicalDuration().getSign());
	public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {		if (context.getProfiler().isEnabled()) {			context.getProfiler().start(this);			context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES",					Dependency.getDependenciesName(this.getDependencies()));			if (contextSequence != null)				context.getProfiler().message(this, Profiler.START_SEQUENCES,						"CONTEXT SEQUENCE", contextSequence);		}        		Sequence result;		if (args.length == 0 || args[0].isEmpty()) {			result = Sequence.EMPTY_SEQUENCE;		} else {			Sequence arg = args[0];			DurationValue duration = new DurationValue(((DurationValue) arg.itemAt(0)).getCanonicalDuration());			if (isCalledAs("days-from-duration")) {            result = new IntegerValue(duration.getPart(DurationValue.DAY));			} else if (isCalledAs("hours-from-duration")) {            result = new IntegerValue(duration.getPart(DurationValue.HOUR));			} else if (isCalledAs("minutes-from-duration")) {            result = new IntegerValue(duration.getPart(DurationValue.MINUTE));			} else if (isCalledAs("seconds-from-duration")) {	    		result = new DecimalValue(Double.toString(duration.getSeconds()));			} else if (isCalledAs("months-from-duration")) {            result = new IntegerValue(duration.getPart(DurationValue.MONTH));			} else if (isCalledAs("years-from-duration")) {            result = new IntegerValue(duration.getPart(DurationValue.YEAR));			} else {				throw new Error("can't handle function " + mySignature.getName().getLocalName());			}		}				if (context.getProfiler().isEnabled()) 			context.getProfiler().end(this, "", result);				return result;			}