Accessing array value for Post request XML

I have to run several Post requests in Postman using XML format. I have to run same function for several ID’s. So i use variables. If i use variable id1, id2 the request looks like this:

{{id1}}
{{id2}}
If the id’s are saved in an array and the values can be found in id[0], id[2] etc. The request does not work like this:

{{id[0]}}
What is the correct way to write the request using a variable stored in an array?

@ywa Could you share more details about whether or not the IDs are static or dynamic?