title: deserializing xml file from xstream
body: <p>I am using Xstream to serializing a Job object. It looks working fine.</p>
  
  <p>but deserializing, I have a problem:</p>
  
  <pre><code>Exception in thread "main" com.thoughtworks.xstream.io.StreamException:  : only whitespace content allowed before start tag and not . (position: START_DOCUMENT seen .... @1:1) 
      at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:78)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:137)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:130)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:109)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:94)
      at com.thoughtworks.xstream.io.xml.XppReader.&lt;init&gt;(XppReader.java:48)
      at com.thoughtworks.xstream.io.xml.XppDriver.createReader(XppDriver.java:44)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
  </code></pre>
  
  <p>Did one of you get this problem before?</p>
  
  <p>This is the way, I did for serializing:</p>
  
  <pre><code>XStream xstream = new XStream();                    
  Writer writer = new FileWriter(new File("model.xml"));
  writer.write(xstream.toXML(myModel));
  writer.close();
  </code></pre>
  
  <p>I also try this as well:</p>
  
  <pre><code>XStream xstream = new XStream();                    
  OutputStream out = new FileOutputStream("model.xml");
  xstream.toXML(myModel, out);
  </code></pre>
  
  <p>For deserializing, I did it like this:</p>
  
  <pre><code>XStream xstream = new XStream();
  
  xstream.fromXML("model.xml");
  </code></pre>
  
  <p>XML structure:</p>
  
  <pre><code>&lt;projectCar.CarImpl&gt; 
     &lt;CarModel reference="../.."&gt;&lt;/CarModel&gt;
  &lt;/projectCar.CarImpl&gt; 
  </code></pre>
  
  <p>If yes, I would like to hear. Thanks in advance.</p>