XDocument descendants

<?xml version="1.0" encoding="ISO-8859-1"?> 
<kdd>
<Table>
    <robel ID="1">
        <groof NAME="GOBS-1">
            <sintal ID="A">Cynthia1</sintal>
            <sintal ID="B">Sylvia2</sintal>
            <sintal ID="C">Sylvia3</sintal>
            <sintal ID="D">Sylvia4</sintal>
        </groof>
        <groof NAME="GOBS-2">
            <sintal ID="A">Cynthia1</sintal>
            <sintal ID="B">Cynthia2</sintal>
            <sintal ID="C">Cynthia3</sintal>
            <sintal ID="D">Cynthia4</sintal>
        </groof>
        <groof NAME="GOBS-3">
            <sintal ID="A">Daniella1</sintal>
            <sintal ID="B">Daniella2</sintal>
            <sintal ID="C">Daniella3</sintal>
            <sintal ID="D">Daniella4</sintal>
        </groof>
    </robel>
</Table> 
</kdd>

J'aimerais obtenir des GOBS-2 Cynthia1. Remarque il y a un autre Cynthia1 de GOBS-1

foreach (XElement element in doc.Descendants("groof"))
                {
                    string mmname = element.Attribute("NAME").Value.ToString();

                        if (mmname == "GOBS-2")
                        {
                            bool found = false; 
                            foreach (XElement element1 in doc.Descendants("sintal"))
                            {

                                if (found == false)
                                {
                                    string CurrentValue = (string)element1;
                                    if ("Cynthia1" == CurrentValue)
                                    {
                                        try
                                        {
                                            //do something
                                            found = true;
                                        }
                                        catch (Exception e)
                                        {
                                        }
                                    }
                                }
                            }
                        }

le problème est que après avoir trouvé Cynthia1 de Gobs-2, la boucle va jusqu'à Gobs-1.
Je pense qu'il y a un problème avec la deuxième foreach pour sintal
peut-être que je devrais utiliser autre chose.
Je veux qu'après qu'il trouve des Gobs-2 sintal il s'arrête juste à la recherche. il semble que le 2 foreach ne sont pas liés. en cours d'exécution sur chaque propre

OriginalL'auteur John Ryann | 2014-03-18