I have an xml
<Root>
<Parent>
<Child1><Node1>AAA</Node1><Node2>BBB</Node2></Child1>
<Child2><NodeX>XXX</NodeX><NodeY>YYY</NodeY></Child2>
<Child1><Node1>EEE</Node1><Node2>FFF</Node2></Child1>
<Child2><NodeX>GGG</NodeX><NodeY>HHH</NodeY></Child2>
<OtherChild></OtherChild>
</Parent>
</Root>
Child2 always will be with child1. I need to know how I can loop through using xsl:foreach and create an XML output example. I may have other nodes like <OtherChild>
but my concern
is only Child1 and Chid2 nodes
<TransformedXML>
<Child attributefromNode1="AAA" attributefromNode2="BBB" attributefromNodeX="XXX" attributeFromNodeY="YYY"/>
<Child attributefromnode1="EEE" attributefromNode2="FFF" attributefromNodeX="GGG" attributeFromNodeY="HHH"/>
</TransformedXML>
My question is how do I loop in XSLT considering Child2 node will follow a Child1 always?