I am updating my xml grammar file from C#. I am successfully inserted child node within node. I want to insert child node with attribute. I have done this but format is wrong.I want to add new node named as and its attribute names ad having value like this out = "Karaa chee";
.****
<?xml version="1.0" encoding="utf-8"?>
<grammar xml:lang="en-US" root="top" mode="voice" tag-format="semantics/1.0"
sapi:alphabet="x-microsoft-ups"
version="1.0" xmlns="http://www.w3.org/2001/06/grammar"
xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">
<rule id="top" scope="public">
<item>
<ruleref uri="#CityName"/>
<tag> out = "src=" + rules.latest(); </tag>
</item>
to
<item>
<ruleref uri="#CityName"/>
<tag> out += "^dst=" + rules.latest(); </tag>
</item>
</rule>
<rule id="CityName" scope="private">
<one-of>
<item>
Abbottabad
<tag>out = "Abbott aabaad";</tag>
</item>
<item>
Karachi
<tag>out = "Karaa chee";</tag>
</item>
<item>
New Item here
<tag>out = "new item pronunciation here";</tag>
</item>
</one-of>
</rule>
</grammar>
Here C# code that i used to add node and its attribute
XmlElement eleItem = xmlDoc.CreateElement("item", ns);
eleItem.InnerText = item;
eleItem.SetAttribute("tag", val);
foundNode.AppendChild(eleItem);