BOM Structure view with Substitute details

We are trying to fetch set of specific BOM substitute parts that are added on the Part BOM relationship of Root Part. And display it similar to BOM Structure tree view with addition filters on property. The substitute part added has to be replaced on the view with the Part on with it is present but the BOM Structure for the remaining has to be the same.