Fragment Parents
If your document contains many different XML substructures, each of which is a good candidate to be a fragment, then it would be time consuming to specify each substructure as a fragment root. Instead, you can specify fragments by setting the parent of these substructures to be a fragment parent—so that every substructure under this parent becomes a separate fragment, regardless of its name.
The following diagram shows a document with substructures of different names:
In this case, you can use the <Products>
element as a fragment parent, and the <Books>
, <Movies>
, <Music>
, <Games>
, and <Toys>
children automatically become fragments.