public XDocument ToXDocument() { using (XmlReader reader = CreateReader()) { return XDocument.Load(reader); } } #endif