﻿<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Add an Element to a XML Document</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Adds a new element to an XML document instance.</Description>
      <Shortcut>xmlAdd</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Xml.dll</Assembly>
          <Url />
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>System.Xml</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>Element</ID>
          <Type>String</Type>
          <ToolTip>Replace with the name of the new element.</ToolTip>
          <Default>"Keyword"</Default>
        </Literal>
        <Literal>
          <ID>Value</ID>
          <Type>String</Type>
          <ToolTip>Replace with the text of the new element.</ToolTip>
          <Default>"Value"</Default>
        </Literal>
        <Object>
          <ID>XmlDoc</ID>
          <Type>XmlDocument</Type>
          <ToolTip>Replace with an XmlDocument instance.</ToolTip>
          <Default>xmlDoc</Default>
        </Object>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Dim newElement As XmlNode
newElement = $XmlDoc$.CreateElement($Element$)
newElement.InnerText = $Value$
$XmlDoc$.AppendChild(newElement)]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>