﻿<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Update content of child elements</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Updates the content of child elements.</Description>
      <Shortcut>xmlUpdt</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.XML.Linq.dll</Assembly>          
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>System.Xml.Linq</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>Xelem</ID>
          <Type>XElement</Type>
          <ToolTip>Replace this with your XElement.</ToolTip>
          <Default>&lt;xml&gt;&lt;child&gt;oldvalue&lt;/child&gt;&lt;child&gt;oldvalue&lt;/child&gt;&lt;/xml&gt;</Default>
        </Literal>
        <Literal>
          <ID>AxisExpr</ID>
          <Type>String</Type>
          <ToolTip>Replace this with your axis expression.</ToolTip>
          <Default>elem.&lt;child&gt;</Default>
        </Literal>              
        <Literal>
          <ID>newVal</ID>
          <Type>String</Type>
          <ToolTip>Replace this with the new content.</ToolTip>
          <Default>newval</Default>
        </Literal> 
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Dim elem = $Xelem$
        For Each item In $AxisExpr$
            item.SetValue("$newVal$")
        Next]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>