public override XPathNodeIterator SelectDescendants( XPathNodeType nt, bool includeSelf ) {
if ( nt == XPathNodeType.Element ) {
XmlNodeType curNT = source.NodeType;
if ( curNT != XmlNodeType.Document && curNT != XmlNodeType.Element ) {
//only Document, Entity, Element node can have Element node as children ( descendant )
//entity nodes should be invisible to XPath data model
return new DocumentXPathNodeIterator_Empty( this );
}
if ( includeSelf )
return new DocumentXPathNodeIterator_AllElemChildren_AndSelf( this );
return new DocumentXPathNodeIterator_AllElemChildren( this );
}
return base.SelectDescendants( nt, includeSelf );
}