title: PHP Copy xml nodes from one doc to another
body: <p>First of all, I need to Find a parent node by a specific child node value in an xml doc; Then copy some specific children nodes from the parent node to another xml doc.</p>
  
  <p>For instance:</p>
  
  <pre><code>DESTINATION FILE: ('destination.xml') 
  &lt;item&gt;
      &lt;offerStartDate&gt;2012-15-02&lt;/offerStartDate&gt;
      &lt;offerEndDate&gt;2012-19-02&lt;/offerEndDate&gt;
      &lt;title&gt;Item Title&lt;/title&gt; 
      &lt;rrp&gt;14.99&lt;/rrp&gt;
      &lt;offerPrice&gt;9.99&lt;/offerPrice&gt;
  &lt;/item&gt; 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SOURCE FILE: ('source.xml') 
  &lt;items&gt; 
      &lt;item&gt; 
           &lt;title&gt;Item A&lt;/title&gt; 
           &lt;description&gt;This is the description for Item A&lt;/description&gt; 
           &lt;id&gt;1003&lt;/id&gt;
           &lt;price&gt;
               &lt;rrp&gt;10.00&lt;/rrp&gt;
               &lt;offerPrice&gt;4.99&lt;/offerPrice&gt;
           &lt;/price&gt;
           &lt;offer&gt;
               &lt;deal&gt;
                   &lt;isLive&gt;0&lt;/isLive&gt;
               &lt;/deal&gt;
           &lt;/offer&gt;
      &lt;/item&gt;
      &lt;item&gt; 
           &lt;title&gt;Item B&lt;/title&gt; 
           &lt;description&gt;This is the description for Item B&lt;/description&gt; 
           &lt;id&gt;1003&lt;/id&gt;
           &lt;price&gt;
               &lt;rrp&gt;14.99&lt;/rrp&gt;
               &lt;offerPrice&gt;9.99&lt;/offerPrice&gt;
           &lt;/price&gt;
           &lt;offer&gt;
               &lt;deal&gt;
                   &lt;isLive&gt;1&lt;/isLive&gt;
               &lt;/deal&gt;
           &lt;/offer&gt;
      &lt;/item&gt; 
      &lt;item&gt; 
           &lt;title&gt;Item C&lt;/title&gt; 
           &lt;description&gt;This is the description for Item C&lt;/description&gt; 
           &lt;id&gt;1003&lt;/id&gt;
           &lt;price&gt;
               &lt;rrp&gt;9.99&lt;/rrp&gt;
               &lt;offerPrice&gt;5.99&lt;/offerPrice&gt;
           &lt;/price&gt;
           &lt;offer&gt;
               &lt;deal&gt;
                   &lt;isLive&gt;0&lt;/isLive&gt;
               &lt;/deal&gt;
           &lt;/offer&gt;
      &lt;/item&gt; 
  </code></pre>
  
  <p>I want to find the parent node <code>&lt;item&gt;</code> that has it's child node <code>&lt;isLive&gt;</code> value set to "1". Then copy other children nodes of the parent node to the destination xml.</p>
  
  <p>e.g. If parent node <code>&lt;item&gt;</code> has its child node <code>&lt;isLive&gt;</code> set to 1. Copy <code>&lt;title&gt;</code>, <code>&lt;rrp&gt;</code> and <code>&lt;offerPrice&gt;</code> nodes and their values and add them to the destination file as children nodes as shown above.</p>
  
  <p>Pardon my technical lingo if I have not used them correctly.</p>
  
  <p>Many thanks for the help guys!</p>