How to create xml with name space using c# RRS feed

  • Question

  • Hi,

    I need to create a serialized xml element using c# like


        <Node1>Some value</Node1>

        <Node2>Some value</Node2>


    This is an argument for java service for which dot net web application is client.

    Thnx in advance 

    Tuesday, October 27, 2015 9:10 AM


  • Hi Sidharth_Gupta,

    >>How to create xml with name space using c#                                 

    Based on your title, I assume the question is how to create xml with name space using c# . You can create an XML namespace using XNamespace Class.

    Please also refer to for more details

    XNamespace aw = ""; XElement root = new XElement(aw + "Root", "Content"); Console.WriteLine(root);

    This example produces the following output:

    <Root xmlns="">Content</Root>

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 28, 2015 5:42 AM