How do I get the total number of nodes in an xml document?

i've tried
dim myxmlnode as xml.xmlnode

msgbox myxmlnode.childnodes.count

it doesn't work, any ideas? thank you.