/// <summary>
        /// Runtime type builder
        /// </summary>
        /// <param name="moduleBuilder"></param>
        /// <param name="xmlNamespace"></param>
        /// <returns></returns>
        private void CreateRTNamespaceType(ModuleBuilder moduleBuilder, XmlModelNamespaceRoot xmlNamespace)
        {
            // Foreach enum types
            foreach (XmlEnumLayout xmlEnum in xmlNamespace.Enums)
            {
                EnumBuilder typeBuilder = CreateRTEnumType(moduleBuilder, xmlNamespace, xmlEnum);
                var type = typeBuilder.CreateType();
                if (type.IsValueType == false)
                    throw new TypeAccessException("Some issue with creating value type");
            }

            // Foreach structure types
            foreach(XmlStructLayoutRoot xmlStruct in xmlNamespace.Structs)
            {
                TypeBuilder typeBuilder = CreateRTStructType(moduleBuilder, xmlNamespace, xmlStruct);
                var type = typeBuilder.CreateType();
                if (type.IsValueType == false)
                    throw new TypeAccessException("Some issue with creating value type");
            }
        }
        /// <summary>
        /// Runtime struct type builder
        /// </summary>
        /// <param name="moduleBuilder"></param>
        /// <param name="xmlNamespace"></param>
        /// <param name="xmlStruct"></param>
        /// <returns></returns>
        private TypeBuilder CreateRTStructType(ModuleBuilder moduleBuilder, XmlModelNamespaceRoot xmlNamespace, XmlStructLayoutRoot xmlStruct)
        {
            TypeBuilder typeBuilder = moduleBuilder.DefineType(string.Format("{0}.{1}", xmlNamespace.Namespace, xmlStruct.Name),
                        TypeAttributes.Public | TypeAttributes.SequentialLayout | TypeAttributes.Serializable |
                          TypeAttributes.AnsiClass, typeof(ValueType), xmlStruct.Pack);

            if (xmlStruct.Metadata != null)
            {
                CreateRTMetadataAttribute(xmlStruct, typeBuilder);
            }

            // Foreach field
            foreach (XmlStructFieldLayout xmlField in xmlStruct.Fields)
            {
                FieldBuilder fieldBuilder = CreateRTFieldType(typeBuilder, xmlStruct, xmlField);
            }

            return typeBuilder;
        }
        /// <summary>
        /// Runtime enum type builder
        /// </summary>
        /// <param name="moduleBuilder"></param>
        /// <param name="xmlNamespace"></param>
        /// <param name="xmlEnum"></param>
        /// <returns></returns>
        private EnumBuilder CreateRTEnumType(ModuleBuilder moduleBuilder, XmlModelNamespaceRoot xmlNamespace, XmlEnumLayout xmlEnum)
        {
            Type enumType = FactoryStandardType.Get(xmlEnum.NetType);
            EnumBuilder enumBuilder = moduleBuilder.DefineEnum(string.Format("{0}.{1}", xmlNamespace.Namespace, xmlEnum.Name),
                        TypeAttributes.Public, enumType);

            // Foreach field
            foreach (XmlEnumKeyValueLayout xmlkeyValue in xmlEnum.Keys)
            {
                if (FactoryStandardType.IsNumericTypes(xmlEnum.NetType))
                {
                    enumBuilder.DefineLiteral(xmlkeyValue.Name, FactoryStandardType.ConvertToNumeric(xmlEnum.NetType, xmlkeyValue.Value, xmlEnum.NumberBase));
                }
            }

            return enumBuilder;
        }