def findByPath(self, rel, path):
if((path=="<STR_LIT>") or (path=="<STR_LIT:/>")):<EOL><INDENT>return(self)<EOL><DEDENT>(front,dummy,rest) = path.lstrip("<STR_LIT:/>").partition("<STR_LIT:/>")<EOL>for child in self.items:<EOL><INDENT>if front in child.values(rel):<EOL><INDENT>return child.findByPath(rel, rest)<EOL><DEDENT><DEDENT>return None<EOL>
Traverses children, building a path based on relation <rel>, until given path is found.