code: public DTMAxisIterator getAxisIterator(final int axis)
    {
  
      DTMAxisIterator iterator = null;
  
      switch (axis)
      {
      case Axis.SELF :
        iterator = new SingletonIterator();
        break;
      case Axis.CHILD :
        iterator = new ChildrenIterator();
        break;
      case Axis.PARENT :
        return (new ParentIterator());
      case Axis.ANCESTOR :
        return (new AncestorIterator());
      case Axis.ANCESTORORSELF :
        return ((new AncestorIterator()).includeSelf());
      case Axis.ATTRIBUTE :
        return (new AttributeIterator());
      case Axis.DESCENDANT :
        iterator = new DescendantIterator();
        break;
      case Axis.DESCENDANTORSELF :
        iterator = (new DescendantIterator()).includeSelf();
        break;
      case Axis.FOLLOWING :
        iterator = new FollowingIterator();
        break;
      case Axis.PRECEDING :
        iterator = new PrecedingIterator();
        break;
      case Axis.FOLLOWINGSIBLING :
        iterator = new FollowingSiblingIterator();
        break;
      case Axis.PRECEDINGSIBLING :
        iterator = new PrecedingSiblingIterator();
        break;
      case Axis.NAMESPACE :
        iterator = new NamespaceIterator();
        break;
      case Axis.ROOT :
        iterator = new RootIterator();
        break;
      default :
        throw new DTMException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED, 
          new Object[]{Axis.getNames(axis)})); 
          //"Error: iterator for axis '" + Axis.names[axis]
                               //+ "' not implemented");
      }
  
      return (iterator);
    }
docs: This is a shortcut to the iterators that implement the
  XPath axes.
  Returns a bare-bones iterator that must be initialized
  with a start node (using iterator.setStartNode()).
  
  @param axis One of Axes.ANCESTORORSELF, etc.
  
  @return A DTMAxisIterator, or null if the given axis isn't supported.