your code is outdated, DocumentNavigator was probably in .NET beta, try the following instead:XmlDocument xmldoc= new XmlDocument(); 
xmldoc.Load(Server.MapPath("Contents.xml")); 
//装入xsl对象 
XslTransform xsldoc = new XslTransform(); 
xsldoc.Load(Server.MapPath("news.xsl")); 
//把xml转化成html页面 
xsldoc.Transform(xmldoc,null,writer); 
return writer.ToString(); }