title: Simple Scala XML parsing
body: <p>I have an XML file containing a couple hundred messages like the following, denoting passage times of a car at checkpoints.</p>
  
  <pre><code>&lt;ttt:appMsg xmlns:ttt="railrt/ttt/v0100" channel="rct" id="019176" time="2016-06-08T06:01:01.260"&gt;
  &lt;rct:st prodDatum="2016-06-08" Number="62713"&gt;
      &lt;pbpData pat="2016-06-08T04:28:02" pbpID="RY@P121" pdt="2016-06-08T04:28:02"/&gt;
      &lt;pbpData pat="2016-06-08T04:28:11" pbpID="RY@P5215" pdt="2016-06-08T04:28:13"/&gt;
      &lt;pbpData pat="2016-06-08T04:28:31" pbpID="RY@P5221" pdt="2016-06-08T04:28:31"/&gt;
      &lt;pbpData pat="2016-06-08T04:28:40" pbpID="RY@P5223" pdt="2016-06-08T04:28:41"/&gt;
      &lt;pbpData pat="2016-06-08T04:28:47" pbpID="RY@P5233" pdt="2016-06-08T04:28:49"/&gt;
      &lt;pbpData pat="2016-06-08T04:28:56" pbpID="RY@P5241" pdt="2016-06-08T04:28:56"/&gt;
      &lt;pbpData pat="2016-06-08T04:29:04" pbpID="RY@P5243" pdt="2016-06-08T04:29:06"/&gt;
      &lt;pbpData pat="2016-06-08T04:29:25" pbpID="RY@P5245" pdt="2016-06-08T04:29:29"/&gt;
      &lt;pbpData pat="2016-06-08T04:29:38" pbpID="RY@P5247" pdt="2016-06-08T04:29:40"/&gt;
      &lt;pbpData pat="2016-06-08T04:29:51" pbpID="RY@P5253" pdt="2016-06-08T04:29:54"/&gt;
      &lt;pbpData pat="2016-06-08T04:30:08" pbpID="ER@P5261" pdt="2016-06-08T04:30:13"/&gt;
      &lt;pbpData pat="2016-06-08T05:59:18" pbpID="POLS@P127" pdt="2016-06-08T05:59:18"/&gt;
      &lt;pbpData pat="2016-06-08T06:00:28" pbpID="POLS@POLS31P" pdt="2016-06-08T06:00:28"/&gt;
      &lt;pbpData pat="2016-06-08T06:01:19" pbpID="POLS@POLS41P" pdt="2016-06-08T06:01:19"/&gt;
      &lt;pbpData pat="2016-06-08T06:01:41" pbpID="POLS@POLS316P" pdt="2016-06-08T06:01:41"/&gt;
      &lt;pbpData pat="2016-06-08T06:01:56" pbpID="POLS@POLS318P" pdt="2016-06-08T06:01:56"/&gt;
      &lt;pbpData pat="2016-06-08T06:02:09" pbpID="POLS@POLS320P" pdt="2016-06-08T06:02:09"/&gt;
      &lt;pbpData pat="2016-06-08T06:02:16" pbpID="BIA@POLS322P" pdt="2016-06-08T06:02:16"/&gt;
  &lt;/rct:st&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am new to Scala, but from what I've been reading around, there is an easy way (i.e., in few lines of code) to parse this and store into a Car object  attributes like an ID ("Number" in the rat:st tag) and a list of checkpoints (the "pbpData" lines, each of them identified by a node ID and two time variables).</p>
  
  <p>Furthermore, do you think there is a way to save those times in the format YYYY-MM-DDThh:mm:ss with Scala as Date attributes? I was searching around but only found a <a href="http://alvinalexander.com/java/simpledateformat-convert-date-to-string-formatted-parse" rel="nofollow">tutorial</a> for changing the Date/Time format in Java, that only really explains how to change the way a Date we have is displayed, whereas I wish to do the contrary: saving this funnily written date/time as a valid Scala time.</p>
  
  <p>Thanks everyone.</p>