using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Collections.Generic;
using System.Web.Services;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    [WebMethod]
public static string[] GetItemList(string prefixText, int
count)
{
   List<string> suggestions = new List<string>();
   using (XmlTextReader reader = new
   XmlTextReader(HttpContext.Current.Server
   .MapPath("~/Countries.xml")))
   {
      while (reader.Read())
      {
         if (reader.NodeType == XmlNodeType.Element &&
         reader.Name == "Item")
         {
            string itemName = reader.ReadInnerXml();
            if (itemName.StartsWith(prefixText,
            StringComparison.InvariantCultureIgnoreCase))
            {
                  suggestions.Add(itemName);
                  if (suggestions.Count == count) break;
            }
         }
      }
   }
   return suggestions.ToArray();
}

}
