How to add container tag to following xml web service

violettagoa

New Member
I am creating an xml schema as\[code\]\[code\]<?xml version="1.0" encoding="UTF-8"?><string xmlns="http://tempuri.org/"><Inventories><ID> </ID><Category> </Category><Identity> </Identity><Name> </Name></Inventories></string>\[/code\]\[/code\]with the following code\[code\]resultList = remoteWeb.Lists.GetByTitle("Server");context.Load(resultList);context.ExecuteQuery();items = resultList.GetItems(new CamlQuery());context.Load(items);context.ExecuteQuery();foreach (ListItem item in items){ rootNode.AppendChild(doc.CreateElement("ID")).InnerText = "pcat:401820"; rootNode.AppendChild(doc.CreateElement("Category")).InnerText = "Infrastructure.Server"; rootNode.AppendChild(doc.CreateElement("Identity")).InnerText = Convert.ToString(item["ID"]); rootNode.AppendChild(doc.CreateElement("Name")).InnerText = Convert.ToString(item["Server_Name"]) + " >> " + Convert.ToString(item["Computer_Name"]) + " >> " + Convert.ToString(item["IP"]);}\[/code\]But we need to make xml as\[code\]<?xml version="1.0" encoding="UTF-8"?><string xmlns="http://tempuri.org/"><Inventories><Inventory><ID> </ID><Category> </Category><Identity> </Identity><Name> </Name></Inventory></Inventories>\[/code\]but did not figure out how to add container node under All help will be appreciated, and thanks in advance
 
Back
Top