You're creating the settings, but then not passing them to anything:
Dim lobjSettings As New XmlWriterSettings()
lobjSettings.Indent = True
lobjSettings.NewLineOnAttributes = True
You should use them when you create the XmlWriter
:
Dim filename = Path.Combine(mstrFolderName, txtActionName.Text & ".xml")
Dim lobjWriter = XmlWriter.Create(filename, lobjSettings)
(I've separated out the filename from the writer creation just for formatting, but please note the use of Path.Combine
as well.)