Ancestry.Daisy.Documentation.CommentDocumentation.AllInclusiveValue C# (CSharp) Method

AllInclusiveValue() private method

private AllInclusiveValue ( System.Xml.Linq.XElement ele ) : string
ele System.Xml.Linq.XElement
return string
        private string AllInclusiveValue(XElement ele)
        {
            bool ignoreNext = false;
            return string.Join(" ", ele.DescendantNodes().Select(x =>
            {
                if (ignoreNext)
                {
                    ignoreNext = false;
                    return null;
                }
                if (x is XText) return ((XText) x).Value;
                if (x is XElement)
                {
                    var xele = (XElement) x;
                    if (xele.IsEmpty) return "<" + xele.Name + "/>";
                    ignoreNext = true;
                    return "<" + xele.Name + ">" + AllInclusiveValue(xele) + "</" + xele.Name + ">";
                }
                return null;
            }).Where(x => x != null));
        }