Source Input
<SiebelMessage MessageId="1-18J35" IntObjectName="XRX R5 Letter Instance" MessageType="Integration Object" IntObjectFormat="Siebel Hierarchical">
<LetterInstance Id="1-1RUYIF" Language="ENU" TemplateType="SA">
<Field Value="CO Last Name" Datatype="String" Name="ContractingOfficerLastName">
</LetterInstance>
</SiebelMessage>
Expected Outcome:
<?xml version="1.0" encoding="UTF-8"?>
<SiebelMessage MessageId="1-18J35" IntObjectName="XRX R5 Letter Instance" MessageType="Integration Object" IntObjectFormat="Siebel Hierarchical">
<LetterInstance Id="1-1RUYIF" Language="ENU" TemplateType="SA">
<ContractingOfficerLastName>CO Last Name</ContractingOfficerLastName>
<PONumber>POTest000001</PONumber>
</LetterInstance>
</SiebelMessage>
Basically getting the value of Name attribute of Field element and construct a new element and then get the value of "Value" attribute and using it as value of new element.
Something along these lines, if I understand you correctly:
This XSL Stylesheet:
Applied to well-formed input:
Produces:
I'm not sure where
<PONumber>
is supposed to be generated from.