title: XSLT alternate parsing output depending on a certain value of an attribute
body: <p>I have the following XML message that I need in name/value pairs and need certain values filled only if there if "Payment" value is present in the name attribute of the extendedDataElements tag. If the value is "Payment" then: </p>
  
  <ul>
  <li>A new name/pair is created with Status as the name and the value being the data that is in the situationQualifier</li>
  <li>The situationQualifier is then filled with some static value that I will hardcode</li>
  <li>The amount tag in the name/value is then changed to trnAmount with its corresponding value.</li>
  </ul>
  
  <p>If the value of the name attribute is anything other than "Payment", then it just reverts to the basic transformation of "element_attribute=value,". I have done the basic transformation to get into name value pairs, but am having much trouble with the conditional step to apply these modifications based on this extendedDataElements value.</p>
  
  <p>Thank you for any help. </p>
  
  <p><strong>XML</strong></p>
  
  <pre><code>    &lt;cbe:CommonBaseEvent&gt;
      &lt;sourceComponentId component="28591" /&gt;
      &lt;situationInformation extensionName="Payment"&gt;
        &lt;extendedDataElements name="Payment"&gt;
          &lt;children name="amount"&gt;
            &lt;values&gt;100&lt;/values&gt;
          &lt;/children&gt;
        &lt;/extendedDataElements&gt;
        &lt;situationType situationQualifier="PaymentCompletionReceived" reasoningScope="INFO"/&gt;
      &lt;/situationInformation&gt;
  &lt;/cbe:CommonBaseEvent&gt;
  </code></pre>
  
  <p><strong>Desired Output:</strong></p>
  
  <pre><code>sourceComponentId_component=28591, extendedDataElements_name=Channel, trnAmount=100, Status=PaymentCompletionReceived, situationType_situationQualifier=StaticValueHere, situationType_reasoningScope=INFO
  </code></pre>