Today's post is an XQuery function designed to get a count of the number of week (or work) days between two dates. It's designed to mimic the Excel
NETWORKDAYS function. I got the algorithm from Bernal Schooley in this thread and then adapted it to XQuery. It also makes use of the FunctX
day-of-week function, so if you have FunctX functions already referenced you can take that part out.