title: Passing xml as parameter to xslt and replacing the xml
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6996998/xslt-for-replace-attribute-in-xml-element-if-it-exists-in-another-xml">XSLT for replace attribute in XML element if it exists in another XML?</a>  </p>
  </blockquote>
  
  
  
  <p>I have two XML:</p>
  
  <p>First XML:</p>
  
  <pre><code>&lt;FirstXML&gt;
    &lt;catalog&gt;
      &lt;cd&gt;
          &lt;title&gt;Empire Burlesque&lt;/title&gt;
          &lt;artist&gt;Bob Dylan&lt;/artist&gt;
          &lt;country&gt;USA&lt;/country&gt;
          &lt;company&gt;Columbia&lt;/company&gt;
          &lt;price&gt;10.90&lt;/price&gt;
          &lt;year&gt;1985&lt;/year&gt;
      &lt;/cd&gt;
    &lt;/catalog&gt;
  &lt;/FirstXML&gt;
  </code></pre>
  
  <p>Second XML:</p>
  
  <pre><code>&lt;SecondXML&gt;
    &lt;catalog&gt;
           &lt;cd&gt;
          &lt;title&gt;Hide your heart&lt;/title&gt;
          &lt;artist&gt;Bonnie Tyler&lt;/artist&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;CBS Records&lt;/company&gt;
          &lt;price&gt;9.90&lt;/price&gt;
          &lt;year&gt;1988&lt;/year&gt;
      &lt;/cd&gt;
    &lt;/catalog&gt;
  &lt;/SecondXML&gt;
  </code></pre>
  
  <p>I want to Transform my First XML using XSLT. The cd node of first xml should be replaced with cd node of second xml.</p>
  
  <p>Resulting XML from XSLT transformation:</p>
  
  <pre><code>&lt;FirstXML&gt;
    &lt;catalog&gt;
      &lt;cd&gt;
          &lt;title&gt;Hide your heart&lt;/title&gt;
          &lt;artist&gt;Bonnie Tyler&lt;/artist&gt;
          &lt;country&gt;UK&lt;/country&gt;
          &lt;company&gt;CBS Records&lt;/company&gt;
          &lt;price&gt;9.90&lt;/price&gt;
          &lt;year&gt;1988&lt;/year&gt;
      &lt;/cd&gt;
    &lt;/catalog&gt;
  &lt;/FirstXML&gt;
  </code></pre>
  
  <p>Please help me with XSLT for this. I think we would need to pass the Second XML as a parameter to the XSLT, I am trying to do that. I am very new to XSLT so might not be coding it correctly.
  Any inputs on how we can do this would be helpful. Thanks in Advance.</p>