The 1st character of a node must be alpha (not alphanumeric)
There are existing routines (but not exposed) in jptree.ipp (isValidXPathChr) and isValidXPathStartChr())

Perhaps this routine should become a utility method in jptree ...