How to get parent Item type recursively

I have structure where, I have to find all the parent Item in my BOM tree, so How to find it by aml query, or  any server side method for finding all parent Item in BOM.  
Parents
  • Actually I write AML query for getting all parent item. In my bom tree I want parent Items (with all properties). i.e I run AML query on item which is at 2nd level in bom, so I want Its parent and Parent's parent (with all) property. Is there any reverse method to do this?
Reply
  • Actually I write AML query for getting all parent item. In my bom tree I want parent Items (with all properties). i.e I run AML query on item which is at 2nd level in bom, so I want Its parent and Parent's parent (with all) property. Is there any reverse method to do this?
Children
No Data