Imagine a case where the source XML document has more complex structure and every <record> element contains much more child elements than shown in the below, and you need to fragment the document into individual record but want only preserve a few attributes. e.g. only "id" and "attr1" are necessary in the subsequent process.
<records> <record id="1"> <attr1>11</attr1> <attr2>12</attr2> </record> <record id="2"> <attr1>21</attr1> <attr2>22</attr2> </record> </records>
You can do that using the XMLFragmenter with Flattening Options followed by the AttributeKeeper etc..
[Edit] My bad. I thought the XMLXQueryExploder with this XQuery expression could perform that more efficiently, but it doesn't work as expected in fact. I don't know why, but the fme:set-attribute function in the expression seems to retrieve the value of <attr1> element under the last <record> element always.
for $r in //record return { xs:string($r/@id), fme:set-attribute('attr1', $r/attr1/text()) }
Also, the transformer has Remove Source XML Attribute? parameter now, but the source XML attribute name won't be hidden even if you set Yes to the parameter. I hope the attribute name could also be hidden.