How to edit a list of object c# linq to xml
<pre><code>&lt;Team Side="Home" TeamRef="ref123"&gt;
&lt;Goal PlayerRef="p1111" Time="10" &gt;
&lt;Assist PlayerRef="p9999"&gt;p9999&lt;/Assist&gt;
&lt;/Goal&gt;
&lt;Goal PlayerRef="p4444" Time="11" &gt;
&lt;Assist PlayerRef="p9999"&gt;p9999&lt;/Assist&gt;
&lt;/Goal&gt;
&lt;Goal PlayerRef="p7777 Time="13" &gt;
&lt;Assist PlayerRef="p9999"&gt;p9999&lt;/Assist&gt;
&lt;/Goal&gt;
&lt;Goal PlayerRef="p7777 Time="17" &gt;
&lt;Assist PlayerRef="p9999"&gt;p9999&lt;/Assist&gt;
&lt;/Goal&gt;
&lt;/Team&gt;

public void GetScorer(string side, string OCompetition, string OSeason, string OGameId)
{
        try
        {
            var xDoc = XDocument.Load(test);

            var query = from q in xDoc.Descendants("Team")
                        where (string)q.Attribute("Side") == side

                        from d in q.Elements("Goal")
                        select new
                        {
                            TeamRef = q.Attribute("TeamRef").Value,
                            PlayerRef = d.Attribute("PlayerRef").Value,
                            Time = d.Attribute("Time").Value
                        };

            var count = 0;
            foreach (var qq in query)
            {
                if (side == "Home")
                {
                    if (HomeSlateScorerList[count].PlayerRef != qq.PlayerRef)
                    {
                        HomeSlateScorerList.Add(new Scorer() { PlayerRef = qq.PlayerRef, Time = qq.Time, LastName = GetPlayerNameSlate(qq.PlayerRef, OSeason, OCompetition, OGameId) });
                    }
                    else
                    {
                        HomeSlateScorerList[count].Time = HomeSlateScorerList[count].Time + "' ";
                    }

                }

                if (side == "Away")
                {
                    AwaySlateScorerList.Add(new Scorer() { PlayerRef = qq.PlayerRef, Time = qq.Time,  LastName = GetPlayerNameSlate(qq.PlayerRef, OCompetition, OSeason, OGameId) });
                }
                count++;
            }
        }
        catch (Exception)
        {
            // ignored
        }
}
</code></pre>

<p>I would like to edit a player in a list of players </p>

<pre><code>HomeSlateScorerList = new List&lt;Scorer&gt;();
AwaySlateScorerList = new List&lt;Scorer&gt;();
</code></pre>

<p>what I would like to achieve is for e.g. there are two players with the ref of "p7777" so in the list of object I would like to have one player with the playerref of "p7777" so if the player exist the format will be </p>

<p>playerref = "p7777"
Time = 13' 17'</p>

<p>or if one player its
Time = 13'</p>

<p>or if another goal is added to the xml its
Time = 13' 17' 25'</p>