public void x_document()
    {
      Assert.Throws<ArgumentNullException>(() => XmlExtensions.XDocument(null));
      Assert.Throws<XmlException>(() => TextReader.Null.XDocument());

      const string Xml = "<?xml version=\"1.0\"?><article>text</article>";

      using (var reader = new StringReader(Xml))
      {
        Assert.Equal("<article>text</article>", reader.XDocument().ToString());
        Assert.Equal(-1, reader.Read());
      }

      using (var reader = new StringReader(Xml))
      {
        Assert.Equal("<article>text</article>", reader.XDocument(true).ToString());
        Assert.Equal(-1, reader.Read());
      }
    }