\ndoc := XMLDOMParser parseDocumentFrom: (FileDirectory current fileNamed: 'file.xml').\ndoc tagsNamed: 'attr' do:\n[:each |\n each contentsDo:\n [:t | t isText ifTrue: [t string: (((t string asLowercase split: '_') collect: [:s | s capitalized]) join: '_') ]]\n].\n(FileDirectory current forceNewFileNamed: 'file.xml') nextPutAll: (doc asString); close.\n
Edit: fixed formatting