private ImportingElement checkAttributesRefSelect(XmlElement node)
    {
        ImportingElement importingElem = new ImportingElement();

        XmlNodeList items = node.GetElementsByTagName("item");
        XmlElement uniqueItem = (XmlElement)items.Item(0);
        if (uniqueItem.GetElementsByTagName("label").Item(0).FirstChild != null)
            importingElem.label = uniqueItem.GetElementsByTagName("label").Item(0).FirstChild.Value.ToString();
        else importingElem.label = "";
        if (node.Attributes.GetNamedItem("ref") != null)
        {
            importingElem.reference = node.Attributes.GetNamedItem("ref").Value.ToString();
            importingElem.generateName();
        }
        importingElem.type = "select";
        if (node.Attributes.GetNamedItem("type") != null)
            importingElem.typeAttribute = node.Attributes.GetNamedItem("type").Value.ToString();

        return importingElem;
    }
    private ImportingElement checkAttributesRefSelect1(XmlElement node)
    {
        ImportingElement importingElem = new ImportingElement();

        if (node.Attributes.GetNamedItem("appearance") != null)
            importingElem.select1Appearance = node.Attributes.GetNamedItem("appearance").Value.ToString();
        if (node.GetElementsByTagName("label").Item(0).FirstChild != null)
            importingElem.label = node.GetElementsByTagName("label").Item(0).FirstChild.Value.ToString();
        else importingElem.label = "";
        if (node.Attributes.GetNamedItem("ref") != null)
        {
            importingElem.reference = node.Attributes.GetNamedItem("ref").Value.ToString();
            importingElem.generateName();
        }
        if (node.Attributes.GetNamedItem("reflist") != null)
            importingElem.refListName = node.Attributes.GetNamedItem("reflist").Value.ToString();

        XmlNodeList itemList = node.GetElementsByTagName("item");
        Debug.WriteLine("Found " + itemList.Count + " items in select1 node");
        for (int i = 0; i < itemList.Count; i++)
        {
            XmlElement item = (XmlElement)itemList.Item(i);
            string labelValue = "";
            string itemValue = "";

            labelValue = item.GetElementsByTagName("label").Item(0).FirstChild.Value.ToString();
            itemValue = item.GetElementsByTagName("value").Item(0).FirstChild.Value.ToString();
            if (labelValue != "Select" && itemValue == "0")
                importingElem.select1Labels.Add(labelValue);
        }
        importingElem.type = "select1";
        if (node.Attributes.GetNamedItem("type") != null)
            importingElem.typeAttribute = node.Attributes.GetNamedItem("type").Value.ToString();

        return importingElem;
    }
    private ImportingElement checkAttributesRefInput(XmlElement node)
    {
        ImportingElement importingElem = new ImportingElement();

        if (node.Attributes.GetNamedItem("ref") != null)
        {
            importingElem.reference = node.Attributes.GetNamedItem("ref").Value.ToString();
            importingElem.generateName();
        }
        importingElem.type = "input";
        if (node.Attributes.GetNamedItem("type") != null)
        {
            importingElem.typeAttribute = node.Attributes.GetNamedItem("type").Value.ToString();
        }
        else importingElem.typeAttribute = "";
        if (!importingElem.typeAttribute.Contains("label"))
        {
            if (node.GetElementsByTagName("label").Item(0).FirstChild != null)
                importingElem.label = node.GetElementsByTagName("label").Item(0).FirstChild.Value.ToString();
            else importingElem.label = "";

        }
        else if (node.Attributes.GetNamedItem("labelvalue") != null)
        {
            importingElem.label = node.Attributes.GetNamedItem("labelvalue").Value.ToString();
        }
        else importingElem.label = "";
        if (node.Attributes.GetNamedItem("calc") != null)
        {
            importingElem.calculated = node.Attributes.GetNamedItem("calc").Value.ToString();
        }

        return importingElem;
    }