title: SAML Assertion WriteXML issue in C#
body: <p>I've created an instance of a SamlAssertion, and added the the authorization statement and attribute statments to it, and now I want to print out the XML so I can do an HTTP post, but not all of the assertion is being outputed.  What am I missing (I'm sure it's something bone-headed)?</p>
  
  <p>Here is the code I'm using:</p>
  
  <pre><code>// Add the Statements to the SAML Assertion
     samlAssert.Statements.Add(samlAuthStatement);
     samlAssert.Statements.Add(samlAttrStatement);
     MemoryStream xmlStream = new MemoryStream();
     XmlDictionaryWriter xmlWriter = XmlDictionaryWriter.CreateTextWriter(xmlStream, System.Text.Encoding.UTF8);
     SamlSerializer samlAssertSerializer = new SamlSerializer();
     WSSecurityTokenSerializer secTokenSerializer = new WSSecurityTokenSerializer();
     samlAssert.WriteXml(xmlWriter, samlAssertSerializer, secTokenSerializer);
  
     xmlStream.Position = 0;
     StreamReader sr = new StreamReader(xmlStream, System.Text.Encoding.UTF8);
     string AssertStr = sr.ReadToEnd();
     TextBox1.Text = AssertStr;
  </code></pre>
  
  <p>But All that gets returned is this:</p>
  
  <pre><code>&lt;saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="assertID" 
                  Issuer="my Company" IssueInstant="2008-11-19T19:54:12.191Z" 
                  xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"&gt;
      &lt;saml:Conditions NotBefore="2008-11-19T19:54:12.191Z" NotOnOrAfter="2008-11-19T19:59:12.191Z"/&gt;
      &lt;saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken" 
                                    AuthenticationInstant="2008-11-19T19:54:12.191Z"&gt;
          &lt;saml:Subject&gt;
              &lt;saml:NameIdentifier Format="cs-sstc-schema-assertion-1.1.xsd" NameQualifier="My company"&gt;xxxx&lt;/saml:NameIdentifier&gt;
              &lt;saml:SubjectConfirmation&gt;
                  &lt;saml:ConfirmationMethod&gt;urn:oasis:names:tc:SAML:1.0:cm:bearer&lt;/saml:ConfirmationMethod&gt;
              &lt;/saml:SubjectConfirmation&gt;
          &lt;/saml:Subject&gt;
          &lt;saml:SubjectLocality IPAddress="x.x.x.x"/&gt;
          &lt;/saml:
  </code></pre>