I have SQL table which has following data
path | Level 1 | Level 2 | Level 3 | Level 4 | LEAF |
---|---|---|---|---|---|
A-B-C | ---A---- | ---B--- | ---C--- | -------- | N |
A-B-C-D | ---A---- | ---B--- | ---C--- | ----D--- | Y |
A-B-E-F | ---A---- | ---B--- | ---E--- | ----F--- | Y |
A-B-E-G | ---A---- | ---B--- | ---E--- | ----G--- | Y |
Now based on above data I want form xml tree hierarchy and save the data as .xml file I am using SQL, SSIS and XSLT Template
Expected Output should be like
`<A>
<B>
<C>
<D></D>
</C>
<E>
<F></F>
<G></G>
</B>
</A>`
Could anyone help how I can achieve this?
I have tried with for xml path approach but I couldn't get it. Solution with xslt template will do