List<Element> children = new ArrayList<Element>();
Element current = ...
children.add(current);
// if the current element has children, list will be increased.
for (int i = 0; i < children.size(); i++)
{
current = children.get(i);
// add all children into end of this list, so it emulates a recursion.
children.addAll(current.getOwnedElement());
}