/// <summary> /// Converts the given navigable into an XNode. /// </summary> /// <param name="navigable"></param> /// <returns></returns> public static XNode ToXNode(this IXPathNavigable navigable) { Checker.NotNull(navigable, "navigable"); using (var reader = navigable.CreateXmlReader()) { // This bit is needed to avoid an error that says the XmlReader state isn't Interactive. reader.MoveToContent(); return(XNode.ReadFrom(reader)); } }