Optimize Arraylist function call
Assuming you have an xml structure that would be similar to:

&lt;Responses&gt;
    &lt;Response&gt;
        &lt;Item&gt;
            &lt;cityname&gt;abc&lt;/cityname&gt;
            &lt;regionname&gt;def&lt;/regionname&gt;
            &lt;latitude&gt;101.2345&lt;/latitude&gt;
            &lt;longitude&gt;34.3456&lt;/longitude&gt;
        &lt;/Item&gt;
        &lt;Item&gt;
            &lt;cityname&gt;ghi&lt;/cityname&gt;
            &lt;regionname&gt;jkl&lt;/regionname&gt;
            &lt;latitude&gt;101.2345&lt;/latitude&gt;
            &lt;longitude&gt;34.3456&lt;/longitude&gt;
        &lt;/Item&gt;
        &lt;Item&gt;
            &lt;cityname&gt;mno&lt;/cityname&gt;
            &lt;regionname&gt;pqr&lt;/regionname&gt;
            &lt;latitude&gt;101.2345&lt;/latitude&gt;
            &lt;longitude&gt;34.3456&lt;/longitude&gt;
        &lt;/Item&gt;
        &lt;Item&gt;
            &lt;cityname&gt;stu&lt;/cityname&gt;
            &lt;regionname&gt;vwx&lt;/regionname&gt;
            &lt;latitude&gt;101.2345&lt;/latitude&gt;
            &lt;longitude&gt;34.3456&lt;/longitude&gt;
        &lt;/Item&gt;
    &lt;/Response&gt;
&lt;/Responses&gt;


You could use the XMLSerializer class to deserialize the whole file all at once, by creating a class to contain the data:

Public Class Responses
    Public Class Item
        Dim cityname As String = ""
        Dim regionname As String = ""
        Dim latitude As Double = 0.0
        Dim longitude As Double = 0.0
    End Class
    &lt;XmlArrayAttribute("Response")&gt;
    Dim items As New List(Of Item)
End Class


Getting the data would be as simple as:

XMLDoc.Load(GetXML)
Dim result As Responses = CType(New XmlSerializer(GetType(Responses)) _
.Deserialize(New StringReader(XMLDoc.OuterXml)), Responses)


You would access the data through the items field of result:

result.items(0).cityname