Added GetValidNodeName to make sure node name only contains A-Z,a-z,0-9,period,hyphen and underscore as it is used to generate a file name