Xml file Creation in Windows phone 7 app using visiual studio 2010 c#
I have created xml successfully using visual studio 2008 but same syntax not supported for visual studio 2010 windows phone 7 application

am using Following name space

    using System.Xml.Linq;
    using System.Xml;

**my code is**


{

     XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.OmitXmlDeclaration = true;
                settings.NewLineOnAttributes = true;
                byte[] byteArray = Encoding.UTF8.GetBytes(filename);
                MemoryStream strm = new MemoryStream(byteArray);
                XmlWriter writer = XmlWriter.Create(strm, settings);
                writer.WriteStartDocument(true);
                writer.WriteComment("sample XML");
                writer.WriteStartElement("root-node");
                writer.WriteElementString("child-node", "The element value");
                writer.WriteStartElement("next-child");
                writer.WriteAttributeString("some-attribute", "A value");
                writer.WriteAttributeString("another-attribute", "Another value");
                writer.WriteValue("The next element value");
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();


**i got error like this**

     Memory stream is not expandable,while Google it i can't find solution . i don't know whether my approach is correct or not.please guide me to proceed further

Xml file Creation in Windows phone 7 app using visiual studio 2010 c#
===

I have created xml successfully using visual studio 2008 but same syntax not supported for visual studio 2010 windows phone 7 application

am using Following name space

    using System.Xml.Linq;
    using System.Xml;

**my code is**


{

     XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.OmitXmlDeclaration = true;
                settings.NewLineOnAttributes = true;
                byte[] byteArray = Encoding.UTF8.GetBytes(filename);
                MemoryStream strm = new MemoryStream(byteArray);
                XmlWriter writer = XmlWriter.Create(strm, settings);
                writer.WriteStartDocument(true);
                writer.WriteComment("sample XML");
                writer.WriteStartElement("root-node");
                writer.WriteElementString("child-node", "The element value");
                writer.WriteStartElement("next-child");
                writer.WriteAttributeString("some-attribute", "A value");
                writer.WriteAttributeString("another-attribute", "Another value");
                writer.WriteValue("The next element value");
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();


**i got error like this**

     Memory stream is not expandable,while Google it i can't find solution . i don't know whether my approach is correct or not.please guide me to proceed further
