Example:
//Include the following namespace at the header position of the page
using CMS.SiteProvider;
//Create the instance for the TreeProvider class
CMS.TreeEngine.TreeProvider provider = new CMS.TreeEngine.TreeProvider(CMS.
CMSHelper.CMSContext.CurrentUser);
//Get the Parent node for the new document
CMS.TreeEngine.TreeNode parent = provider.SelectSingleNode(CMS.CMSHelper.
CMSContext.CurrentSiteName, "/MyNews", "en-us");
//Create a new Tree node at the specified
CMS.TreeEngine.TreeNode node = new TreeNode("cms.news", provider);
if (parent != null)
{
//Now set the properties for the document if the parent node found
node.NodeName = "MyFirstNews";
node.NodeAlias = "MyFirstNews";
node.SetValue("DocumentCulture", "en-us");
node.SetValue("NewsTitle", "MyFirstNewsTitle");
node.SetValue("NewsSummary", "My First News Summary.");
node.SetValue("NewsText", "My First News Text.");
node.SetValue("NewsReleaseDate", DateTime.Now);
//Now insert the document at the proper place New document
node.Insert(parent.NodeID);
}