convert xml to object types
I have xml of the following format coming into pl/sql stored procedure
<ListItems>
<ListItem>
<Field1>f1</Field1>
<Filed2>f2</Field2>
</ListItem>
<ListItem>
<Field1>f1</Field1>
<Filed2>f2</Field2>
</ListItem>
</ListItems>
I would like to convert this xml to object types so that I can refer to the data something like this objectName.fieldName and objectName(index).fieldName.
I was able to achieve objectName.fieldName through xmltype.toobject method.
I created an object type and used toobject method to load data into that type from xml.
I was not able figure out how to load object types when we have lists. I even tried registering a schema and loading data into the types created by oracle. I was able to load data but unable to access data like objectName(index).fieldName.
How can I convert xml that has list of items into an object type so that I can access elements from an array of object type.
thanks for the help