Fixes a bug in getLeavesByValue.
Fixes the strange CLRF added to the code.
A simple optimization for finding one to one relations.
Fixes a bug in xmlutil.