Q:

XML xpath Visual Studio

I am new to Visual Studio and getting my head around a lot of things but I'm stuck and could use some help.
I need to create a drop down list bound to a field in an XML document. I've tried configuring the data source and adding xpath expressions, but nothing shows up and I am not sure what I am doing wrong.
Here is extract from file, and say I wanted any field, i.e. PropertyId?
<PropertyDatabase>

<imageList>
  <Images>
    <ImageId>2</ImageId>
    <PropertyId>60</PropertyId>
    <ThumbUrl>propertyImages/propertyThumb60_8.jpg</ThumbUrl>
    <MainUrl>propertyImages/propertyLarge60_8.jpg</MainUrl>
    <Active />
  </Images>
  <Images>

    <ImageId>3</ImageId>
    <PropertyId>22</PropertyId>
    <ThumbUrl>propertyImages/propertyThumb22_1.jpg</ThumbUrl>
    <MainUrl>propertyImages/propertyLarge22_1.jpg</MainUrl>
    <Active />
  </Images>

A:

You can use the Linq-to-XML construct of XElement to create XML path like queries in C#.
If your file is called 'somexml.xml' then you can do the following
XElement xml = XElement.Load("somexml.xml");
IEnumerable<XElement> propertyIDs = xml.Descendants("PropertyId");
foreach(XElement propertyID in propertyIDs)
{
   //Do stuff with propertyID.Value
}

As you have not specified that you are using C#, here is the code in VB.Net
Dim xml As XElement = XElement.Load("somexml.xml")
Dim propertyIDs As IEnumerable(Of XElement) = xml...<PropertyId>
For Each propertyID As XElement In propertyIDs
  'Do stuff with propertyID.Value
Next

