/// <summary>
        /// Parse .Net XML documentation about this member.
        /// </summary>
        /// <remarks>Clears any existing comments before parsing the new ones.</remarks>
        /// <param name="parent">Expects the tag containing all documentation for this member.</param>
        public void ParseVisualStudioXmlDocumentation(XElement parent)
        {
            parent = parent.CleanWhitespaces();

            ClearComments();

            //todo: refactor: using DotNetComment.Tag, alot of this duplication can be removed

            bool previousCommentWasAParagraphTag = false;

            foreach (XNode node in parent.Nodes())
            {
                DotNetComment comment = null;
                switch (node.NodeType)
                {
                case XmlNodeType.Element:
                    XElement element = (node as XElement);
                    switch (element.Name.LocalName)
                    {
                    case "example":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        ExampleComments.Add(comment);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "exception":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        ExceptionComments.Add(comment as DotNetCommentQualifiedLinkedGroup);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "param":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        ParameterComments.Add(comment as DotNetCommentParameter);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "permission":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        PermissionComments.Add(comment as DotNetCommentQualifiedLinkedGroup);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "remarks":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        RemarksComments.Add(comment);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "returns":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        ReturnsComments.Add(comment);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "summary":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        SummaryComments.Add(comment);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "typeparam":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        TypeParameterComments.Add(comment as DotNetCommentParameter);
                        previousCommentWasAParagraphTag = true;
                        break;

                    case "value":
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        ValueComments.Add(comment);
                        previousCommentWasAParagraphTag = true;
                        break;

                    default:
                        comment = DotNetComment.FromVisualStudioXml(element);
                        if (comment == null)
                        {
                            break;
                        }
                        if (previousCommentWasAParagraphTag && comment.ToString() == "\n")
                        {
                            break;
                        }
                        FloatingComments.Add(comment);
                        previousCommentWasAParagraphTag = (comment.Tag == CommentTag.Para || comment.Tag == CommentTag.List || comment.Tag == CommentTag.Code);
                        break;
                    }
                    break;

                case XmlNodeType.Text:
                    comment = DotNetComment.FromVisualStudioXml(Utilities.XNodeToString(node));
                    if (comment == null)
                    {
                        break;
                    }
                    if (previousCommentWasAParagraphTag && comment.ToString() == "\n")
                    {
                        break;
                    }
                    FloatingComments.Add(comment);
                    previousCommentWasAParagraphTag = false;
                    break;
                }
            }
        }