You have one holiday date in the wrong format in your XML. Dates are yyyy-MM-dd format. All of your holiday dates are from 2009. Are you testing with dates from 2009? If not, you may want to update those to current dates. I did that in a copy of the file, and then tested, and I believe the output is correct. I'd be concerned about this logic triggering a looping error, however. It seems EndDateWN gets changed a number of times and repeatedly executes Rule 2. I'm not sure if that is part of how this logic works, but I'd be a little concerned about it.