• Below an example of the source xml I mean.

    <Products>

    <Product ID="123" Name="Male Bicycle" Amount="1">

    <Product ID="988" Name="Male Frame" Amount="1"/>

    <Product ID="501" Name="Wheel" Amount="2">

    <Product ID="450" Name="Spoke" Amount="50"/>

    <Product ID="490" Name="Rim" Amount="1"/>

    </Product>

    ...

    </Product>

    <Product ID="234" Name="Female Bicycle" Amount="1">

    <Product ID="998" Name="Female Frame" Amount="1"/>

    <Product ID="501" Name="Wheel" Amount="2">

    <Product ID="450" Name="Spoke" Amount="50"/>

    <Product ID="490" Name="Rim" Amount="1"/>

    </Product>

    ...

    </Product>

    </Products>

    I would like to translate to two tables:

    Table 1 = Products:

    - Product ID

    - Product Name

    This table will only contain the distinct records from the xml. So product "Rim" will only appear once even though it has been defined for 20 bicycles.

    Table 2 = BOM:

    - Parent Product ID

    - Component Product ID

    - Amount