It should work if it is compiling i.e TreeNode comes from CMS.DocumentEngine namespace. You probably looking at the wrong document. Check node.DocumentCulture
and node.DocumentName
or node.DocumentID
just to make sure that you looking at the right document.
I see that you are resolving macro so your node.DocumentMenuClass
contains some macro {%somemacro%}. If somemacro fails - you get empty string.