[导入](HOWTO)将一个Xml中的节点复制到别一个Xml的节点上

          }
     // destParent and sourceParent are from different XmlDocuments. 
 
          
// This method will append the children of sourceParent to the destParent's children. 
 
          
public static void TransferChildren(XmlDocument destDoc, XmlNode destParent, XmlNode sourceParent) 
 
          

 
               
// Create a temporary element into which we will add the children. 
 
               XmlElement tempElem 
= destDoc.CreateElement("Temp"); 
 
               tempElem.InnerXml 
= sourceParent.InnerXml; 
 

 
               
foreach(XmlNode node in tempElem.ChildNodes) 
 
                    destParent.AppendChild(node); 
 
          }
  

文章来源:http://ms.mblogger.cn/xuzhong/posts/16522.aspx
原文地址:https://www.cnblogs.com/xuzhong/p/232231.html