function setSelectItems(TagName, elementID, XML)
{
        var items = XML.getElementsByTagName(TagName);
        var _select = document.getElementById(elementID);
        _select.innerHTML = ""; // Удаляем всех потомков.
        //Создаем список с доступными цветами.

        for(i=0;i<items.length;i++)
        {
                var option = document.createElement("option");
                var optionText = document.createTextNode(items[i].firstChild.data);
                option.appendChild(optionText);
                option.setAttribute("value",items[i].getAttribute("value"));
                _select.appendChild(option);
        }
}


<!-- // Required to be compliant with XHTML-->

function loadXML(element, url, defvalue)
{
 var xmlHttp=null; // Defines that xmlHttp is a new variable.
 // Try to get the right object for different browser
 try {
    // Firefox, Opera 8.0+, Safari, IE7+
    xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
 } catch (e) {
    // Internet Explorer
    try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
 }
 xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
       try { // In some instances, status cannot be retrieved and will produce an error (e.g. Port is not responsive)
          if (xmlHttp.status == 200) {
             //Set the main HTML of the body to the info provided by the AJAX Request
             //document.getElementById("ajax_output").innerHTML = xmlHttp.responseText;
             setSelectItems("item", element, xmlHttp.responseXML.documentElement);
             comboBoxSetSelected(element, defvalue);
          }
       } catch (e) {
          //document.getElementById("ajax_output").innerHTML = "Error on Ajax return call : " + e.description;
       }

 }
 xmlHttp.open("get", url); // .open(RequestType, Source);
 xmlHttp.send(null); // Since there is no supplied form, null takes its place as a new form.
}

function comboBoxSetSelected(ElementID, ItemValue)
{
        var Element = document.getElementById(ElementID);

        for (i = 0; i < Element.length; i++)
        {
                if (Element.options[i].value == ItemValue)
                {
                        Element.options[i].selected = true;
                }
        }
}
