I'm using SimpleXML (Java) and I'm trying to get a List of objects based on the value of one of the siblings of the list.So, here's my XML:\[code\]<xml> <metadata> <resources> <resource> <ittype>Service_Links</ittype> <links> <link> <path>http://www.stackoverflow.com</path> <description>Stack Overflow</path> <link> <link> <path>http://www.google.com</path> <description>Google</description> </links> </resource> <resource> <ittype>Article_Links</ittype> <links> ... </links> </resource> ... </resources> </metadata></xml>\[/code\]What I am trying to do is create a SimpleXML-annotation using XPath in order to get a List of all of the "links" where the list's sibling "ittype" equals "Service_Links".So, for example, this works but only if I'm trying to statically get the 1st "resource"-node (as opposed to dynamically getting the "resource"-node based on what it's sibling "ittype" is:\[code\]@ElementList(name="links")@Path("metadata/resources[1]/resource")public List<Link> link;\[/code\]I've tried so many ways to format the xpath to dynamically find the "resource"-node I want that I couldn't possibly list them all here; however, this is one example I've tried that seems to me it should work; no clue what I'm doing wrong...\[code\]@ElementList(name="links")@Path("metadata/resources[resource/ittype='Service_Links']/resource")public List<Link> link;\[/code\]I've googled a ton, including here on SO, and just can't find much very similar; and what I did find, didn't translate well enough for me to spot what I need to do. For example, this SO didn't seem to work even though it's pretty similar.