title: How can i store the ArrayList of complex objects into xml?
body: <p>I have two classes which are having relations with each other as below. I have a list of ObjReal objects where the whole data is presented. I want to save the whole List into xml without losing the object relationships. I mean an object represented in XML should have their corresponding objStrucs along with it.
          To store ObjReal into xml is straight forward but i am getting confused with its ObjStruc relations. Please helpe to solve this problem.</p>
  
  <p>My ObjReal is:</p>
  
  <pre><code>Class ObjReal
  {
    private String id;
    private String data;
  
    ArrayList&lt;ObjStruc&gt; objStrucs=new ArrayList&lt;ObjStruc&gt;();
  
    public ArrayList&lt;ObjStruc&gt; getObjStrucs()
      {
          return objStrucs;
      }
  
    public String getId()
   {
        return id;
   }
  
    public String getData()
      {
        return data;
      }
  
      public void setId(String id)
      {
          this.id=id;
      }
      public void setData(String data)
      {
          this.data=data;
      }
  
  }
  </code></pre>
  
  <p>My ObjStruc is: </p>
  
  <pre><code>Class ObjStruc
  {
      private ObjReal objReal;
      public ObjReal getObjReal()
   {
        return objReal;
   }
  
    public ObjReal setObjReal(ObjReal objReal)
      {
        this.objReal=objReal;
      }
  
  }
  </code></pre>
  
  <p>And the complete data is in <code>ArrayList&lt;ObjReal&gt; obreals</code> object which i want to dump into xml. I hope i kept a clear point. Thanks in advance.</p>