code: public int getTypedFirstChild(int nodeHandle, int nodeType)
    {
  
      int firstChild, eType;
      if (nodeType < DTM.NTYPES) {
        for (firstChild = _firstch(makeNodeIdentity(nodeHandle));
             firstChild != DTM.NULL;
             firstChild = _nextsib(firstChild)) {
          eType = _exptype(firstChild);
          if (eType == nodeType
                 || (eType >= DTM.NTYPES
                        && m_expandedNameTable.getType(eType) == nodeType)) {
            return makeNodeHandle(firstChild);
          }
        }
      } else {
        for (firstChild = _firstch(makeNodeIdentity(nodeHandle));
             firstChild != DTM.NULL;
             firstChild = _nextsib(firstChild)) {
          if (_exptype(firstChild) == nodeType) {
            return makeNodeHandle(firstChild);
          }
        }
      }
      return DTM.NULL;
    }
docs: Given a node handle, get the handle of the node's first child.
  If not yet resolved, waits for more nodes to be added to the document and
  tries again.
  
  @param nodeHandle int Handle of the node.
  @return int DTM node-number of first child, or DTM.NULL to indicate none exists.