Q:

How can I read single xml node

I am creating a language translation using xml. How can i read the id using value='Username'.
This is my related post How can I get a node by id in XML? but now i want to retrieve id using value.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <!--Language 1-->
    <word>
        <id>1</id>
        <value>Username</value>
    </word>
    <word>
        <id>2</id>
        <value>TradingID</value>
    </word>
    <word>
        <id>3</id>
        <value>Password</value>
    </word>

    <!--Language 2-->
    <word>
        <id>10001</id>
        <value>新密碼</value>
    </word>
    <word>
        <id>10002</id>
        <value>用户ID</value>
    </word>
    <word>
        <id>10003</id>
        <value>AAA</value>
    </word>

    <!--Language 3-->
    <word>
        <id>20001</id>
        <value>BBB</value>
    </word>
    <word>
        <id>20002</id>
        <value>CCC</value>
    </word>
    <word>
        <id>20003</id>
        <value>DDD</value>
    </word>
</root>

Code Behind:
XmlDocument xmlDocument;
FileInfo fileInfo;

string xPath = CommonEntity.XmlDirectory;
fileInfo = new FileInfo(xPath);
xmlDocument = new XmlDocument();
xmlDocument.Load(fileInfo.FullName);

var node = xmlDocument.SelectSingleNode("//*[@id='10001']");
return node.InnerText;

Many thanks in advance.

A:

//value[text()='Username']/preceding-sibling::id

Try something like the above

