title: The best way to format data for writing to XML
body: <p>I'd like to create an XML document like this:</p>
  
  <pre><code>&lt;prefs&gt;
  &lt;exactmap&gt;
      &lt;map&gt;
          (UCS point_1 : x =  50.0, y =  50.0)
          (UCS point_2 : x = 300.0, y = 200.0)
          (UCS point_3 : x = 200.0, y = 400.0)
          (UCS point_4 : x = 300.0, y = 300.0)
      &lt;/map&gt;
  &lt;/exactmap&gt;
  &lt;/prefs&gt;
  </code></pre>
  
  <p>I wrote a code and it looks like a mess))</p>
  
  <pre><code>let writeToXMLDoc: NSString = "&lt;prefs&gt;\n\t&lt;exactmap&gt;\n\t\t&lt;map&gt;\n\t\t\t//(UCS point_1 : x =  50.0, y =  50.0 )\n\t\t\t(UCS point_2 : x = 300.0, y = 200.0 )\n\t\t\t(UCS point_3 : x = 200.0, y = 400.0 )\n\t\t\t(UCS point_4 : x = 300.0, y = 300.0 )\n\t\t&lt;/map&gt;\n\t&lt;/exactmap&gt;\n&lt;/prefs&gt;"
  </code></pre>
  
  <p>How to make it more readable in Swift? Is there a possible way to create a separate XML-formatted file in Xcode project? How to do that?</p>
  
  <p>And in case it's possible to create a separate file, how to feed variables for x and y?</p>