private IEnumerable<XElement> FindContentControls(XElement content, string tagName) { return content //top level content controls .FirstLevelDescendantsAndSelf(W.sdt) //with specified tagName .Where(sdt => tagName == sdt.SdtTagName()); } }