how to parse a structure with {,},[,] to tree?
===

how to parse a structure with {,},[,] as shown below (much like json)in java to store it in hierarchical structured xml.Any algorithm or api exists?

    instance p = Parser
    {
    	example_source = Text("1 2 3 4 * 5 6 7 8 * 1 2 3 4");
    	contains = 
    	[
    		SetValue("end of iteration", XPath("$v")), 
    		RepeatingGroup<separator_position="between">
    		{
    			target = 
    			[
    				Locator(XPath("$MyList"))
    			];
    			contains = 
    			[
    				RepeatingGroup<separator_position="between">
    				{
    					contains = 
    					[
    						Content(null_searcher, null_searcher, null_searcher, XPath("$MyList/*s/item"))
    					];
    					separator = Marker(TextSearch(StaticString(" ")));
    				}, 
    				WriteValue(XPath("$MyList")), 
    				WriteValue(XPath("$v"))
    			];
    			separator = Marker(TextSearch(StaticString("*")));
    		}
    	];
    	format = CustomFormat();
    }
    instance v = Variable()
    instance MyList = Variable(XSDTypeRef("MyListType"))

 