I am attempting to merge an XML file with another xml containing override values. I'd like to use an XSLT to perform this merge, however, examples I have seen elsewhere all seem to assume a simple xml structure. In my case, I have multiple levels, not all elements are present at each node.

Example xml
Code:
<config>
  <FieldAttrs>
     <Name>Name1</Name>
     <Field>
       <Name>FName1</Name>
       <FieldId>field1<FieldId>
       <Type>Bool</Type>
     </Field>
     <Name>Name2</Name>
     <Field>
       <Name>FName2</Name>
       <FieldId>field2<FieldId>
       <Type>Enumeration</Type>
       <Enumeration>
         <Enum>
            <Number>1</Number>
            <Value>Stock</Value>
         </Enum>
         <Enum>
           <Number>2</Number>
           <Value>Option</Value>
         </Enum>
       </Enumeration>
     </Field>
  </FieldAttrs>
 <FieldAttrs>
     <Name>Name2</Name>
     <Field>
       <Name>FName1</Name>
       <FieldId>field1<FieldId>
       <Type>Bool</Type>
     </Field>
     <Name>Name3</Name>
     <Field>
       <Name>FName3</Name>
       <FieldId>field2<FieldId>
       <Type>Enumeration</Type>
       <Enumeration>
         <Enum>
            <Number>1</Number>
            <Value>Stock</Value>
         </Enum>
         <Enum>
           <Number>3</Number>
           <Value>Option</Value>
         </Enum>
       </Enumeration>
     </Field>
  </FieldAttrs>
</config>
The overide might look like:
Code:
<FieldAttrs>
     <Name>Name1</Name>
     <Field>
       <Name>FName1</Name>
       <FieldId>field4<FieldId>
       <Type>quantity</Type>
     </Field>
</FieldAttrs>
and I'd like the transform to output like:
Code:
<config>
  <FieldAttrs>
     <Name>Name1</Name>
     <Field>
       <Name>FName1</Name>
       <FieldId>field4<FieldId>  
     <Type>Quantity</Type>
     </Field>
     <Name>Name2</Name>
     <Field>
       <Name>FName2</Name>
       <FieldId>field2<FieldId>
       <Type>Enumeration</Type>
       <Enumeration>
         <Enum>
            <Number>1</Number>
            <Value>Stock</Value>
         </Enum>
         <Enum>
           <Number>2</Number>
           <Value>Option</Value>
         </Enum>
       </Enumeration>
     </Field>
  </FieldAttrs>
 <FieldAttrs>
     <Name>Name2</Name>
     <Field>
       <Name>FName1</Name>
       <FieldId>field1<FieldId>
       <Type>Bool</Type>
     </Field>
     <Name>Name3</Name>
     <Field>
       <Name>FName3</Name>
       <FieldId>field2<FieldId>
       <Type>Enumeration</Type>
       <Enumeration>
         <Enum>
            <Number>1</Number>
            <Value>Stock</Value>
         </Enum>
         <Enum>
           <Number>3</Number>
           <Value>Option</Value>
         </Enum>
       </Enumeration>
     </Field>
  </FieldAttrs>
</config>
I am really not sure how to proceed from here. Any examples I have seen expect me to know the structure of the xml, but as you can see from the Enumeration type, sometimes there is an extra level, which may have 1 - n nodes.