Nick Code XML refactor

coded back in the code that I took out and make into functions. Also
cleaned out the underscore in the name for these nodes.