It's not entirely clear to me whether Adam's solution is what you want, but if not, you might want to look at the NextNode property:
Gets the next sibling node of this node.
For instance, this prints the array element:
using System;
using System.Linq;
using System.Xml.Linq;
class Test
{
static void Main()
{
XDocument doc = XDocument.Load("test.xml");
foreach (var element in doc.Descendants("key")
.Where(x => (string) x == "jobSteps"))
{
Console.WriteLine(element.NextNode);
}
}
}
Note that it's skipping the whitespace between elements - but if there were any text between that and the array, it wouldn't work - so you'd want:
Console.WriteLine(element.NodesAfterSelf().OfType().First());