Xml creation question

how do I create following using XmlElement? I couldn’t figure it out.

Peter

Should be something like

XmlElement xmlElement("Name");
xmlElement.addTextElement("Peter");