/// <summary> /// Does the location represent an empty element? /// </summary> /// <param name="location"> /// The XML location. /// </param> /// <param name="emptyElement"> /// Receives the <see cref="XSEmptyElement"/>. /// </param> /// <returns> /// <c>true</c>, if the location represents an empty element; otherwise, <c>false</c>. /// </returns> public static bool IsEmptyElement(this XmlLocation location, out XSEmptyElement emptyElement) { if (location == null) { throw new ArgumentNullException(nameof(location)); } if (!location.IsEmptyElement()) { emptyElement = null; return(false); } else { emptyElement = (XSEmptyElement)location.Node; return(true); } }