public static class Program
public static void Main(string[] args)
var xml = @"<ScheduledCustomerJourneys>
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534454"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534455"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534455"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""538020"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""538020"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""538020"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""538020"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""531228"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534457"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""526977"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""526978"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""538023"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534459"" />
<ScheduledCustomerJourney ScheduledCustomerJourneyId=""534459"" />
</ScheduledCustomerJourneys>";
var doc = XDocument.Parse(xml);
doc.Descendants("ScheduledCustomerJourney")
.GroupBy(x => x.Attribute("ScheduledCustomerJourneyId").Value)
.SelectMany(x => x.Key == string.Empty ? x : x.Skip(1))
Console.WriteLine(doc.ToString());