I have the following XML source structure:
Gives:
410
The two s can be replaced by a single . This would mean one less check during the recursion, but it also means two additional lines of code.