sir first create a xml file named as test1.xml and stored in the debug folder in win application given bellow that manupulating your first xml code
<xml>
<foo>
<x-aln freq="fq1">abldfls lfds fd \hbox{x1}</x-aln>
<x-aln freq="fq2">abldfls lfds fd \hbox{x2}</x-aln>
<x-aln freq="fq3-5">abldfls lfds fd \hbox{z5} dafdsf \hbox{z6} dsfdsf \hbox{z7}</x-aln>
</foo>
<foo id="123">Text 1<moo />Text 2
</foo>
</xml>
then the code behind I define bellow
private void button5_Click(object sender, EventArgs e)
{
string fpath = Application.StartupPath + "\\" + "test1.xml";
XDocument xele = XDocument.Load(fpath);
var node = xele.XPathSelectElement("/xml/foo/x-aln[@freq='fq1']");
var strvalue = node.Value;
int ind = strvalue.IndexOf('\\');
string str = "";
if (strvalue.Substring(ind + 1, 5) == "hbox{")
{
int lind = strvalue.LastIndexOf('}');
str = strvalue.Substring(ind + 6, (lind-(ind + 6)));
MessageBox.Show(str);
}
This give a message box but you can take with a variable