title: replace xml node from bottom to top
body: <p>Hi i have an xml that contains 2 nodes that are equal. i would replace the 1st node that is on top with the node that is on bottom and remove the 2nd node. the 2 nodes are named "ApplicationArea" and contained childs. now the 2nd node contains the original information that i need to replace at the top and remove from the xml on the bottom</p>
  
  <p>my xml is</p>
  
  <pre><code>&lt;SyncShipment versionID="2.6.3" Release="9.2"&gt;
  &lt;ApplicationArea&gt;
  &lt;Sender&gt;
  &lt;LogicalID&gt;lid://infor.dbconnector&lt;/LogicalID&gt;
  &lt;ComponentID&gt;Visual&lt;/ComponentID&gt;
  &lt;ConfirmationCode&gt;OnError&lt;/ConfirmationCode&gt;
  &lt;/Sender&gt;
  &lt;CreationDateTime&gt;2015-03-04T09:25:12.107Z&lt;/CreationDateTime&gt;
  &lt;BODID&gt;infor-nid:infor:Shipper~S14-01709:?Shipment&amp;verb=Sync&lt;/BODID&gt;
  &lt;/ApplicationArea&gt;
  &lt;DataArea&gt;
  &lt;Sync&gt;
  &lt;TenantID&gt;infor&lt;/TenantID&gt;
  &lt;AccountingEntityID&gt;NKFEX&lt;/AccountingEntityID&gt;
  &lt;LocationID&gt;Site~Gouda&lt;/LocationID&gt;
  &lt;ActionCriteria&gt;
  &lt;ActionExpression actionCode="Add"/&gt;
  &lt;/ActionCriteria&gt;
  &lt;/Sync&gt;
  &lt;Shipment&gt;
  &lt;ShipmentHeader&gt;
  &lt;DocumentID&gt;Shipper~S14-01709&lt;/DocumentID&gt;
  &lt;UserArea&gt;
  &lt;Property&gt;
  &lt;NameValue type="String" name="UDF1"&gt;external info&lt;/NameValue&gt;
  &lt;/Property&gt;
  &lt;Property&gt;
  &lt;NameValue type="xml" name="sourceAA"&gt;
  &lt;ApplicationArea&gt;
  &lt;Sender&gt;
  &lt;LogicalID schemeVersionID="VMSHPENT:7.0.0.156:AC7726D2"&gt;lid://infor.visual.visual&lt;/Logical ID&gt;
  &lt;ComponentID&gt;Visual&lt;/ComponentID&gt;
  &lt;ConfirmationCode&gt;OnError&lt;/ConfirmationCode&gt;
  &lt;/Sender&gt;
  &lt;CreationDateTime&gt;2015-03-04T09:25:12.107Z&lt;/CreationDateTime&gt;
  &lt;BODID schemeAgencyName="Visual" location="Site~Gouda"&gt;infor-nid:infor:NKFEX:Site~Gouda:Shipper~S14-01709~1:?Shipment&amp;verb=Sync&lt;/BODID&gt;
  &lt;/ApplicationArea&gt;
  &lt;/NameValue&gt;
  &lt;/Property&gt;
  &lt;/UserArea&gt;
  &lt;/ShipmentHeader&gt;
  &lt;ShipmentItem&gt;
  &lt;ItemID&gt;pippo&lt;/ItemID&gt;
  &lt;/ShipmentItem&gt;
  &lt;/Shipment&gt;
  &lt;/DataArea&gt;
  &lt;/SyncShipment&gt;
  </code></pre>
  
  <p>after the transformation it should be like this</p>
  
  <pre><code>&lt;SyncShipment versionID="2.6.3" Release="9.2"&gt;
  &lt;ApplicationArea&gt;
  &lt;Sender&gt;
  &lt;LogicalID schemeVersionID="VMSHPENT:7.0.0.156:AC7726D2"&gt;lid://infor.visual.visual&lt;/LogicalID&gt;
  &lt;ComponentID&gt;Visual&lt;/ComponentID&gt;
  &lt;ConfirmationCode&gt;OnError&lt;/ConfirmationCode&gt;
  &lt;/Sender&gt;
  &lt;CreationDateTime&gt;2015-03-04T09:25:12.107Z&lt;/CreationDateTime&gt;
  &lt;BODID schemeAgencyName="Visual" location="Site~Gouda"&gt;infor-nid:infor:NKFEX:Site~Gouda:Shipper~S14-01709~1:?Shipment&amp;verb=Sync&lt;/BODID&gt;
  &lt;/ApplicationArea&gt;
  &lt;DataArea&gt;
  &lt;Sync&gt;
  &lt;TenantID&gt;infor&lt;/TenantID&gt;
  &lt;AccountingEntityID&gt;NKFEX&lt;/AccountingEntityID&gt;
  &lt;LocationID&gt;Site~Gouda&lt;/LocationID&gt;
  &lt;ActionCriteria&gt;
  &lt;ActionExpression actionCode="Add"/&gt;
  &lt;/ActionCriteria&gt;
  &lt;/Sync&gt;
  &lt;Shipment&gt;
  &lt;ShipmentHeader&gt;
  &lt;DocumentID&gt;Shipper~S14-01709&lt;/DocumentID&gt;
  &lt;UserArea&gt;
  &lt;Property&gt;
  &lt;NameValue type="String" name="UDF1"&gt;external info&lt;/NameValue&gt;
  &lt;/Property&gt;
  &lt;/UserArea&gt;
  &lt;/ShipmentHeader&gt;
  &lt;ShipmentItem&gt;
  &lt;ItemID&gt;pippo&lt;/ItemID&gt;
  &lt;/ShipmentItem&gt;
  &lt;/Shipment&gt;
  &lt;/DataArea&gt;
  &lt;/SyncShipment&gt;
  </code></pre>
  
  <p>can you help me on this?</p>