zero-padding 1 digit to 2 digits

For example when creating a xs:date where the month is one or two digits

1. substring concat

by Adam Retter

2. concat predicate

by nine9ths

3. concat predicate

by Nick Nunes

4. substring addition

by Michael Kay

5. conditional concat

by Chris Wallace - corrected due to bug found by Michael Kay. Cuased by too-casuall conversion from the original function with n

6. concat operator conditional

by Chris Wallace - revised for XQuery 3.0