title: StreamException: An invalid XML character (Unicode: 0x1a)
body: <p>I am using XStream to save the object of user in a file. </p>
  
  <pre><code>private void store() {
      XStream xStream = new XStream(new DomDriver("UTF-8"));
      xStream.setMode(XStream.XPATH_ABSOLUTE_REFERENCES);
  
      xStream.alias("configuration", Configuration.class);
      xStream.alias("user", User.class);
  
      synchronized (ConfigurationDAOImpl.class) {
          try {
              xStream.toXML(configuration, new FileOutputStream(filename.getFile()));
          } catch (IOException e) {
              throw new RuntimeException("Failed to write to " + filename, e);
          }
      }
  }
  </code></pre>
  
  <p>When I am trying to read it by the following code I get an Exception: com.thoughtworks.xstream.io.StreamException:  : An invalid XML character (Unicode: 0x1a) was found in the element content of the document.</p>
  
  <pre><code>private void lazyLoad() {
      synchronized (ConfigurationDAOImpl.class) {
          // Has the configuration been loaded
          if (configuration == null) {
              if (filename.exists()) {
                  try {
                      XStream xStream = new XStream(new DomDriver("UTF-8"));
                      xStream.setMode(XStream.XPATH_ABSOLUTE_REFERENCES);
  
                      xStream.alias("configuration", Configuration.class);
                      xStream.alias("user", User.class);
  
                      configuration = (Configuration) xStream
                              .fromXML(filename.getInputStream());
  
                      LOGGER.debug("Loaded configuration from {}.", filename);
                  } catch (Exception e) {
                      LOGGER.error("Failed to load configuration.", e);
                  }
              } else {
                  LOGGER.debug("{} does not exist.", filename);
                  LOGGER.debug("Creating blank configuration.");
  
                  configuration = new Configuration();
                  configuration.setUsers(new ArrayList&lt;User&gt;());
  
                  // and store it
                  store();
              }
          }
      }
  }
  </code></pre>
  
  <p>Any idea?</p>