final StepList steps = new StepList(xpath);
Iterator<Step> stepsIterator = steps.iterator();
Collection<Property> properties = null;
Step step = null;
if (stepsIterator.hasNext()) {
step = stepsIterator.next();
properties = ((ComplexAttribute) root).getProperties(Types.toTypeName(step.getName()));
}
while (stepsIterator.hasNext()) {
step = stepsIterator.next();
Collection<Property> nestedProperties = new ArrayList<Property>();
for (Property property : properties) {
assert property instanceof ComplexAttribute;
Collection<Property> tempProperties = ((ComplexAttribute) property)
.getProperties(Types.toTypeName(step.getName()));
if (!tempProperties.isEmpty()) {
nestedProperties.addAll(tempProperties);
}
}
properties.clear();