merge xml results by comparing attributes