title: Ho to convert Saml2SecurityToken to XML form?
body: <p>I am working with WIF and I create an instance of  <code>Saml2SecurityToken</code>, now I would like to save this token as XML, so that I can use it in testing - I cannot see obvious way of doing it however.</p>
  
  <p>I have seen <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/34b326e5-504f-4b76-9803-a67eab547d19/saml2securitytoken-to-xmlelement?forum=Geneva" rel="nofollow">this</a> answer that suggest using <code>SecurityTokenHandler</code> however this class has a protected constructor, so I cannot just new it up.</p>