c# - Converting an XML file to string type -
how can write xml file string variable? here code have,the variable content supposed return xml string:
public string getvalues2() { string content = ""; xmltextwriter textwriter = new xmltextwriter(content, null); textwriter.writestartelement("student"); textwriter.writestartelement("r", "record", "urn:record"); textwriter.writestartelement("name", ""); textwriter.writestring("student"); textwriter.writeendelement(); textwriter.close(); return contents; }
something this
string xmlstring = system.io.file.readalltext(filename);
here answer create xmldocument
xdocument or xmldocument
Comments
Post a Comment