Here is a solution that works better with multiple tu nodes:
XDocument xDoc = XDocument.Load(path);
foreach (XElement tu in xDoc.Root.Descendants("tu"))
{
Console.WriteLine("tu = " + tu.Attribute("creationid").Value);
foreach (XElement tuv in tu.Descendants("tuv"))
{
if (tuv.ToString().Contains("\"en-GB\""))
{
Console.WriteLine("seg = " + tuv.Descendants("seg").First().Value);
}
}
Console.WriteLine();
}
XML data must have a Root element:
<Root>
<tu creationdate="20130619T135814Z" creationid="John" changedate="20130619T135814Z" changeid="John" lastusagedate="20130619T135814Z">
<prop type="x-LastUsedBy">John</prop>
<prop type="x-Origin">TM</prop>
<prop type="x-OriginalFormat">TestTool</prop>
<tuv xml:lang="de-DE">
<seg>This is the German text</seg>
</tuv>
<tuv xml:lang="en-GB">
<seg>This is the English text</seg>
</tuv>
</tu>
<tu creationdate="20130619T135814Z" creationid="Rick" changedate="20130619T135814Z" changeid="Rick" lastusagedate="20130619T135814Z">
<prop type="x-LastUsedBy">Rick</prop>
<prop type="x-Origin">TM</prop>
<prop type="x-OriginalFormat">TestTool</prop>
<tuv xml:lang="de-DE">
<seg>This is Ricks German text</seg>
</tuv>
<tuv xml:lang="en-GB">
<seg>This is Ricks English text</seg>
</tuv>
</tu>
</Root>