
Assembling XML with String Operations
String name = …String attribute = …String xml = “”+””+ name +””+”; Many beginners are tempted to create an XML file like the one listed above using String operations because it is easier, but this approach fails to escape reserved characters. If one of the variable name or attribute contain