How Do I Add a New Line in Xml

1 Answer. You can use 
 for line feed

How do I create a new line in XML?

You can use \n for new line and \t for tabs. Also, extra spaces/tabs are just copied the way you write them in Strings. xml so just give a couple of spaces where ever you want them.

How do you insert a line break in XML?

XML does not require a specific form of line break, so you can use whatever is convenient (carriage return, linefeed, or a combination) when creating an XML file. XML parsers will do the right thing largely because they’re parsing on tags, not records – so whatever line break you’re using is just whitespace to XML.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest