title: How to read/write objects to xml?
body: <p>I am trying to make a XML Parser of sort that reads in chunks of a class object into a file and should also be able to edit the same.</p>
  
  <p>The class structure is as follows</p>
  
  <pre><code>[Serializable]
  public class Service
  {
      public enum ServiceStatus { ACTIVE, INACTIVE, SUSPENDED };
  
      //Unique identifier for a service
      string _Id;
      public string Id 
      {   get{ return _Id;} 
          set{ _Id = value;} 
      }
  
      //Name of the service, for reference of the client
      string _name;
      public string Name
      {
          get { return _name; }
          set { _name = value; }
      }
  
      //URI where the service is hosted
      string _uri;
      public string Uri
      {
          get { return _uri; }
          set { _uri = value; }
      }
  
      //The state of the service
      ServiceStatus _status;
      public ServiceStatus Status
      {
          get { return _status;}
          set { _status = value; }
      }
  
      //the categories contained in the service instance
  
      public ICollection&lt;Category&gt; Categories;
  
      //collection of users/clients who can access this service
      public ICollection&lt;Client&gt; Clients;
  
  
      public Service()
      {
          _Id = null;
          _name = null;
          _uri = null;
          _status = ServiceStatus.ACTIVE;
          Categories = new List&lt;Category&gt;();
          Clients = new List&lt;Client&gt;();
      }
  }
  </code></pre>
  
  <p>The Category class is as follows</p>
  
  <pre><code>public class Category
  {
      //Unique identifier for a category
      string _Id;
      public string Id
      {
          get { return _Id; }
          set { _Id = value; }
      }
  
      //Name of the category, for reference of the client
      string _name;
      public string Name
      {
          get { return _name; }
          set { _name = value; }
      }
  
      //URI where the category is hosted
      string _uri;
      public string Uri
      {
          get { return _uri; }
          set { _uri = value; }
      }
  
      //Collection of pulses in this category
  
      public ICollection&lt;Pulse&gt; Pulses;
  
      public Category()
      {
          _Id = null;
          _name = null;
          _uri = null;
          Pulses = new List&lt;Pulse&gt;();
      }
  }
  </code></pre>
  
  <p>The pulse class is a similar class with just id and name.</p>
  
  <p>What would be the best way to read/write such objects in an xml file. The operation is read heavy and I would like to have the values read as accessible as possible, possible as array indexed or as a dictionary, but any form is fine.</p>
  
  <p>Kindly suggest the simplest way. I am overwhelmed by the number of classes for XML in c#</p>