xml判断是不是有子节点(msxml)

xml判断是否有子节点(msxml)
_bstr_t str = pNode->nodeName;
pNode->get_childNodes(&pNodesTemp);
long num11=pNodesTemp->length;

当str分别为FileName1,FileName2,FileName3时num11都为1,为FileName4时num11为2
请问如何判断FileName1与FileName2或者与FileName3的区别?因为一个没有子节点,一个有子节点


<?xml version="1.0" encoding="gb2312"?>
<Files>
<FileName1>00000</FileName1>
<FileName2>
<FileName>
<Ver>12366789</Ver>
<User>eu765ff</User>
</FileName>
</FileName2>
<FileName3>
<FileName>
<Ver>12366789</Ver>
</FileName>
</FileName3>
<FileName4>
<Ver>12366789</Ver>
<User>eu765ff</User>
</FileName4>
</Files>

------解决方案--------------------

不要用递归,用标志栈能够很好完成。
------解决方案--------------------
通过 
IXMLDOMNode 的 nodetype来获得

NODE_ELEMENT (1)
 The node represents an element. An element node can have the following child node types: Element, Text, Comment, ProcessingInstruction, CDATASection, and EntityReference. An element node can be the child of the Document, DocumentFragment, EntityReference, and Element nodes.
 
NODE_ATTRIBUTE (2)
 The node represents an attribute of an element. An attribute node can have the following child node types: Text and EntityReference. An attribute does not appear as the child node of any other node type; note that it is not considered a child node of an element.
 
NODE_TEXT (3)
 The node represents the text content of a tag. A text node cannot have any child nodes. A text node can appear as the child node of the Attribute, DocumentFragment, Element, and EntityReference nodes.
 
NODE_CDATA_SECTION (4)
 The node represents a CDATA section in the XML source. CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. A CDATA section node cannot have any child nodes. A CDATA section node can appear as the child of the DocumentFragment, EntityReference, and Element nodes.
 
NODE_ENTITY_REFERENCE (5)
 The node represents a reference to an entity in the XML document. This applies to all entities, including character entity references. An entity reference node can have the following child node types: Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference. An entity reference node can appear as the child of the Attribute, DocumentFragment, Element, and EntityReference nodes.