title: How to conver a XML file to ArrayList
body: <p>I have to convert a xml file to array list, but I don't know how.
  This is how my xml file looks like.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="true"?&gt;
  &lt;data&gt;
     &lt;record&gt;
        &lt;name&gt; abc &lt;/name&gt;
        &lt;email&gt; abc@abc &lt;/email&gt;
     &lt;/record&gt;
     &lt;record&gt;
        &lt;name&gt; asd &lt;/name&gt;
        &lt;email&gt; asd@asd &lt;/email&gt;
     &lt;/record&gt;
        .
        .
        .
  &lt;/data&gt;
  </code></pre>
  
  <p>My array list built of Contact class, which looks like that:</p>
  
  <pre><code>public class Contact{
      public String name;
      public String email;
      public Contact(String name,String email){
          this.name=name;
          this.email=email;
      }
      public boolean contains(String str){
          return name.contains(str)|| email.contains(str);
      }
      @Override
      public String toString() {
          return name+"\n"+email;
      }
  }
  </code></pre>