There are some excellent XPath tutorials over
here[
^] that'll show you just about everything you need to know.
I think that something like this might do the trick for you;
using System;
using System.IO;
using System.Xml.XPath;
namespace Sandbox
{
class Program
{
static void Main(string[] args)
{
string xml = "<package><workflowprocesses><workflowprocess></workflowprocess><workflowprocess><activites><activity><version>1.0.0.0</version></activity></activites></workflowprocess></workflowprocesses></package>";
XPathDocument document = new XPathDocument(new StringReader(xml));
XPathNavigator navigator = document.CreateNavigator();
XPathNodeIterator versionList = navigator.Select("/package/workflowprocesses/workflowprocess/activites/activity/version");
foreach (XPathNavigator versionElement in versionList)
{
string version = versionElement.Value;
Console.WriteLine("Version=[{0}]", version);
}
}
}
}
Hope this helps,
Fredrik