title: Read XML file with XmlReader (PortableClassLibrary)
body: <p>I'm trying to read a xml file wiht XMLReader. In my WPF solution, it looked like this:</p>
  
  <pre><code>public XmlDocument XmlDoc;
  XmlReaderSettings settings;
  XElement Catalogue;
  
  public void LoadXML(string XML_File)
  {
    XmlReader reader = XmlReader.Create(XML_File, settings);
    XmlDoc.Load(reader);
  
    Catalogue = XElement.Load(new XmlNodeReader(XmlDoc));
  }
  </code></pre>
  
  <p>Since I'm using Portable Class Library (Silverlight, WP8, .NET 4.5, Windows 8), there's no <code>XMLDocument</code> and no <code>XmlNodeReader</code>. I've tried to do it like this now:</p>
  
  <pre><code>public void LoadXML(string XML_File)
  {
      XmlReader reader = XmlReader.Create();
  
      XDocument XmlDocx = XDocument.Load(reader);
  
      Catalogue = XElement.Load(reader);
  }
  </code></pre>
  
  <p>but I don't know how I can put the string <code>XML_File</code> (which contains for example 'Users.xml') into the reader. XmlReader.Create() needs as a parameter a StreamReader or Textreader and when I declare a new StreamReader, the StreamReader needs as a parameter a Stream...? So yeah, I did it like that</p>
  
  <pre><code>public void LoadXML(string XML_File)
  {
      //How to put the XML_File in the Stream?
      //I could say Stream sra = Stream.Null; - but I still need to put the XML_File string somehow into the reader
      Stream s = new Stream();
      StreamReader sr = new StreamReader(s);
  
      XmlReader reader = XmlReader.Create(sr);
  
      XDocument XmlDocx = XDocument.Load(reader);
  
      Questions = XElement.Load(reader);
  }
  </code></pre>
  
  <p>How can I put the XML_File ('Users.xml') into the reader so that I can load the reader with my <code>XmlDoc</code>?</p>