IMPORTANT: You should look at the comment posted by first. In the meantime there was a supported way added to SDK 3.0.4 which describes to change entities, ISV.config, ...
SiteMap XML is a really cool new feature in MS CRM 3.0. The most exciting thing for me is the ability to restrict access to Areas of the SiteMap by specific privileges in MS CRM. In most cases you would modify the SiteMap XML using the supported way by manually exporting, modifying and then importing the XML using the MS CRM UI. But there may be cases when you need to do this programmatically (e.g. using an installer). And there is a way ... but it's not documented in the SDK (at least I didn't find it). So this is totally unsupported and you must use it on your own risk blabla.
There are two web services used for this located in MSCRMServices: ExportXmlWebService and ImportXmlWebService. Just look at the code sample to figure out how to do it:
ExportXmlWebService exportService=new ExportXmlWebService();
exportService.Credentials=System.Net.CredentialCache.DefaultCredentials;
exportService.Url="http://localhost/mscrmservices/exportxml.asmx";
// get the sitemap xml
XmlDocument sitemapDoc=new XmlDocument();
sitemapDoc.LoadXml(
exportService.Export("<export><entities></entities><nodes><node>sitemap</node></nodes></export>")
);
// add new sub area
XmlElement subArea=sitemapDoc.CreateElement("SubArea");
XmlAttribute attrId=sitemapDoc.CreateAttribute("Id");
attrId.Value="nav_sometest";
XmlAttribute attrTitle=sitemapDoc.CreateAttribute("Title");
attrTitle.Value="Click me for happiness";
XmlAttribute attrIcon=sitemapDoc.CreateAttribute("Icon");
attrIcon.Value="some.gif";
XmlAttribute attrUrl=sitemapDoc.CreateAttribute("Url");
attrUrl.Value="/someurl.aspx";
XmlAttribute attrClient=sitemapDoc.CreateAttribute("Client");
attrClient.Value="Web";
subArea.Attributes.Append(attrId);
subArea.Attributes.Append(attrTitle);
subArea.Attributes.Append(attrIcon);
subArea.Attributes.Append(attrUrl);
subArea.Attributes.Append(attrClient);
sitemapDoc.SelectSingleNode(
"/ImportExportXml/SiteMap/SiteMap/Area[./@Id = 'Settings']/Group[./@Id = 'Settings']"
).AppendChild(subArea);
ImportXmlWebService importService=new ImportXmlWebService();
importService.Credentials=System.Net.CredentialCache.DefaultCredentials;
importService.Url="http://localhost/mscrmservices/importxml.asmx";
// reimport the sitemap xml
importService.Import("<import><entities></entities><nodes><node>sitemap</node></nodes></import>",
sitemapDoc.OuterXml);
For isv.config use: <export><entities></entities><nodes><node>isvconfig</node></nodes></export>
For any entity use: <export><entities><entity>account</entity></entities><nodes></nodes></export>
Of course you are able to combine any nodes and entities.
P.S. If you copy and paste this code sample, don't forget to add the two web references and the correct using statements in VS.