<Path>
<StartStation>富锦路</StartStation> 
  <EndStation>上海火车站</EndStation> 
  <StartLine>1号线</StartLine> 
  <EndLine>不知道</EndLine> 
  <Time>29分钟</Time> 
  <Money>5元</Money> 
  </Path>
- <Path>
  <StartStation>上海火车站</StartStation> 
  <EndStation>江杨北路</EndStation> 
  <StartLine>3号线</StartLine> 
  <EndLine>不知道</EndLine> 
  <Time>40分钟</Time> 
  <Money>5元</Money>  </Path>
比如说上面这个~~~
把第一个 path复制然后粘贴到下面变成了
   <Path>
<StartStation>富锦路</StartStation> 
  <EndStation>上海火车站</EndStation> 
  <StartLine>1号线</StartLine> 
  <EndLine>不知道</EndLine> 
  <Time>29分钟</Time> 
  <Money>5元</Money> 
  </Path>
<Path>
<StartStation>富锦路</StartStation> 
  <EndStation>上海火车站</EndStation> 
  <StartLine>1号线</StartLine> 
  <EndLine>不知道</EndLine> 
  <Time>29分钟</Time> 
  <Money>5元</Money> 
  </Path>
 <Path>
  <StartStation>上海火车站</StartStation> 
  <EndStation>江杨北路</EndStation> 
  <StartLine>3号线</StartLine> 
  <EndLine>不知道</EndLine> 
  <Time>40分钟</Time> 
  <Money>5元</Money>  </Path>
高分求。在线等风花雪月大雪天裸奔求

解决方案 »

  1.   

    xml.DocumentElement.InsertAfter(xml.ImportNode(node, true));
      

  2.   


    1.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <paths>
    <Path1>
      <StartStation>富锦路</StartStation> 
      <EndStation>上海火车站</EndStation> 
      <StartLine>1号线</StartLine> 
      <EndLine>不知道</EndLine> 
      <Time>29分钟</Time> 
      <Money>5元</Money> 
    </Path1>
    <Path2>
      <StartStation>上海火车站</StartStation> 
      <EndStation>江杨北路</EndStation> 
      <StartLine>3号线</StartLine> 
      <EndLine>不知道</EndLine> 
      <Time>40分钟</Time> 
      <Money>5元</Money>  
    </Path2>
    </paths>XmlDocument xml = new XmlDocument();
    xml.Load(@"E:\1.xml");
    xml.DocumentElement.InsertAfter(xml.ImportNode(xml.DocumentElement.ChildNodes[0], true), xml.DocumentElement.ChildNodes[0]);
    xml.Save(@"E:\2.xml");2.xml<?xml version="1.0" encoding="utf-8"?>
    <paths>
      <Path1>
        <StartStation>富锦路</StartStation>
        <EndStation>上海火车站</EndStation>
        <StartLine>1号线</StartLine>
        <EndLine>不知道</EndLine>
        <Time>29分钟</Time>
        <Money>5元</Money>
      </Path1>
      <Path1>
        <StartStation>富锦路</StartStation>
        <EndStation>上海火车站</EndStation>
        <StartLine>1号线</StartLine>
        <EndLine>不知道</EndLine>
        <Time>29分钟</Time>
        <Money>5元</Money>
      </Path1>
      <Path2>
        <StartStation>上海火车站</StartStation>
        <EndStation>江杨北路</EndStation>
        <StartLine>3号线</StartLine>
        <EndLine>不知道</EndLine>
        <Time>40分钟</Time>
        <Money>5元</Money>
      </Path2>
    </paths>