Thanks a lot for the code review. 

This code is a one to one copy of the sabre dav code.

My intention was to keep the code as unchanged as possible. 

I should have mentioned that.