Q: filling combobox from xml I want to fill my dropdownlist with all the payment methods, i should find the payment methods in an xml file that i have. this should be the xml code for the methods:
    Dim xml As String
    xml = "<?xml version=""1.0"" encoding=""UTF-8""?>"
    xml &= "<gateways ua=""example-php-1.1"">"
    xml &= "<merchant>"
    xml &= " <account>123456</account>"
    xml &= " <site_id>789</site_id>"
    xml &= " <site_secure_code>112233</site_secure_code>"
    xml &= "</merchant>"
    xml &= "<customer>"
    xml &= " <country>NL</country>"
    xml &= " <locale>nl_NL</locale>"
    xml &= "</customer>"
    xml &= " </gateways>"
    Dim apiURl As String

    apiURl = "https://testapi.multisafepay.com/ewx/"


    Dim httpWebRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(apiURl)
    httpWebRequest.Method = "POST"
    httpWebRequest.ContentLength = System.Text.Encoding.UTF8.GetByteCount(xml)
    httpWebRequest.ContentType = "application/x-www-form-urlencoded"

    Dim streamWriter = New System.IO.StreamWriter(httpWebRequest.GetRequestStream())
    streamWriter.Write(xml)
    streamWriter.Close()

    Dim httpWebResponse As System.Net.HttpWebResponse = httpWebRequest.GetResponse()
    Dim streamReader = New System.IO.StreamReader(httpWebResponse.GetResponseStream())
    Dim stringResult = streamReader.ReadToEnd()
    Dim xmlstring As String = stringResult
    Dim xd As System.Xml.XmlDocument = New System.Xml.XmlDocument()
    xd.LoadXml(xmlstring)

the stringResult gives this Value:
<?xml version="1.0" encoding="UTF-8"?>
<gateways result="ok">
<gateways>
<gateway>
<id>IDEAL</id>
<description>iDEAL</description>
</gateway>
<gateway>
<id> MASTERCARD</id>
<description>Visa via Multipay</description>
</gateway>
<gateway>
<id> BANKTRANS</id>
<description> Bank Transfer</description>
</gateway>
<gateway>
<id> VISA</id>
<description> Visa CreditCards</description>
</gateway>
</gateways>
</gateways>

i need to get the value between the <id></id> tags in my ddlMethod how can i do this?

A: You can use SelectNodes() method to get specific nodes from XmlDocument passing suitable XPath string as the method parameter. Since SelectNodes() returns collection of XmlNode, you also need to specify which property of XmlNode to be displayed in the dropdown list control. In this case, I assume you want to display the text between <id> tags so we use InnerText property :
Dim xd As System.Xml.XmlDocument = New System.Xml.XmlDocument()
xd.LoadXml(xmlstring)
'set data source of dropdown to all <id> elements from XML'
ddlMethod.DataSource = xd.SelectNodes("//id")
ddlMethod.DataTextField = "InnerText"
ddlMethod.DataValueField = "InnerText"
ddlMethod.DataBind()

Only if available in the .NET framework version you're using, I'd suggest to switch to XDocument which is more modern XML library in .NET compared to the older XmlDocument. In various situations XDocument is more friendly to use than XmlDocument. Example using XDocument and LINQ style :
Dim xd As XDocument = XDocument.Parse(xmlstring)
'set data soutce of dropdown to *content* of all <id> elements from XML'
ddlMethod.DataSource = xd.Descendants("id").Select(Function(x) x.Value)
ddlMethod.DataBind()


A: i came up with this and it works for me:
 Dim bytTeller As Byte
 For bytTeller = 0 To xd.GetElementsByTagName("gateway").Count - 1
 Dim root As XmlNode = xd.GetElementsByTagName("gateway").Item(bytTeller)
 ddlMethod.Items.Add(root.ChildNodes(0).InnerText)
 Next

