title: Is it possible to create an XmlReader from output SqlParameter of type SqlDbType.Xml?
body: <p>This is my parameter definition:</p>
  
  <pre><code>var param = new SqlParameter
  {
      ParameterName = "@param",
      SqlDbType = SqlDbType.Xml,
      Direction = ParameterDirection.Output,
      Size = int.MaxValue
  };
  command.Parameters.Add(param);
  </code></pre>
  
  <p>Then I do:</p>
  
  <pre><code>command.ExecuteNonQuery();
  </code></pre>
  
  <p>And finally:</p>
  
  <pre><code>XmlSerializer serializer = new XmlSerializer(typeof(MyClass));
  return serializer.Deserialize(
      new MemoryStream(Encoding.UTF8.GetBytes(param.Value.ToString())))
      as MyClass;
  </code></pre>
  
  <p>Do I really need to convert to string and then byte array?</p>