Skip to content

Instantly share code, notes, and snippets.

@BenjaminAbt
Created January 3, 2016 15:21
Show Gist options
  • Save BenjaminAbt/e446019a67a62a2d039a to your computer and use it in GitHub Desktop.
Save BenjaminAbt/e446019a67a62a2d039a to your computer and use it in GitHub Desktop.
C# XML Tutorial - XmlDocument Create Simple Document
XmlDocument xmlDoc = new XmlDocument( );
XmlElement xmlRoot = xmlDoc.CreateElement( "XMLRootName" );
root.SetAttribute( "demo", "SchwabenCode" );
XmlElement child = xmlDoc.CreateElement( "KindElement" );
child.InnerText = "Dies ist ein BeispielText";
xmlRoot.AppendChild( child );
xmlDoc.AppendChild( xmlRoot );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment