public override string SaveStimulusToXml()
        {
            if(m_doOrganism == null)
                throw new System.Exception("No organism was defined for the stimulus '" + m_strName + "'.");

            if(m_doNode == null)
                throw new System.Exception("No node was defined for the stimulus '" + m_strName + "'.");

            if(m_doNode != null && m_thMuscle != null && m_thMuscle.BodyPart != null && m_strMuscleLengthData != null && m_strMuscleLengthData.Length > 0)
            {
                AnimatTools.Interfaces.StdXml oXml = new AnimatTools.Interfaces.StdXml();

                oXml.AddElement("Stimuli");
                SaveXml(ref oXml);

                return oXml.Serialize();
            }
            else
                return "";
        }
        public override string SaveStimulusToXml()
        {
            if(m_doStructure == null)
                throw new System.Exception("No structure was defined for the stimulus '" + m_strName + "'.");

            if(m_doBodyPart == null)
                throw new System.Exception("No bodypart was defined for the stimulus '" + m_strName + "'.");

            if(m_thPrimaryAttachment != null && m_thPrimaryAttachment.BodyPart != null &&
                m_thSecondaryAttachment != null && m_thSecondaryAttachment.BodyPart != null)
            {
                AnimatTools.Interfaces.StdXml oXml = new AnimatTools.Interfaces.StdXml();

                oXml.AddElement("Stimuli");
                SaveXml(ref oXml);

                return oXml.Serialize();
            }
            else
                return "";
        }