CompareNodes throws stack overflow when the object being parsed has multiple elements that are equal <Fields> <Field Name="No" /> <Field Name="Test" /> <Field Name="Test" /> <Field Name="Test" /> </Fields> The code would overflow on "Test".