Json object loop

Hi,

From a webservice i get the following json response:

{
    "@id":"1",
    "@parent":"5",
    "#text":"Sub 1"
},
        
{
    "@id":"2",
    "@parent":"0",
    "#text":"Cat 1"
},
        
{
    "@id":"3",
    "@parent":"2",
    "#text":"Sub 2"
},
        
{
    "@id":"4",
    "@parent":"2",
    "#text":"Sub 3"
},
        
{
    "@id":"5",
    "@parent":"0",
    "#text":"Cat 2"
},
        
{
    "@id":"6",
    "@parent":"5",
    "#text":"Sub 4"
}

I want this output:

Cat 1

  • Sub 2
  • Sub 3

cat 2

  • Sub 1
  • Sub 4

How can i accomplish that? I use jquery.

Thx