- XmlNode node = doc.DocumentElement.FirstChild;
- while ( node!= null )
- {
- // if the node is an elementType
- if( node is XmlElement )
- {
- list.Add( GetNodeValue( node ) );
- }
- node = node.NextSibling;
- }// end while
- // bind the list to datagrid
- private string GetNodeValue( XmlNode node )
- {
- return node.InnerXml;
- }
- //该片段来自于http://www.codesnippet.cn/detail/201220121092.html
来源: http://www.codesnippet.cn/detail/201220121092.html