XPATH 1.0 does not provide date arithmetic functions.1 So I created these XSL templates to produce the same or more precise results than the VBScript date functions. The DateAdd and DateDiff templates use seconds since Epoch (January 1, 1970). A year is defined to be a leap year if (year mod 400 = 0) or [ (year mod 100 != 0) and (year mod 4 = 0) ]. Try it out by modfying the highlighted fields and clicking the "Transform It" button.
<dateadd> <startdate> </startdate> <numtoadd> </numtoadd> <dateinterval> days months years </dateinterval> </dateadd> <datediff> <datea> </datea> <dateb> </dateb> <dateinterval> days months years </dateinterval> </datediff>