title: How to create xml to Pojo or java object in android
body: <pre><code>&lt;LIST&gt;
      &lt;Item&gt;
          &lt;Cmd&gt;1002&lt;/Cmd&gt;
          &lt;Name&gt;PHOTO_SIZE&lt;/Name&gt;
          &lt;MenuList&gt;
              &lt;Option&gt;
                  &lt;Index&gt;0&lt;/Index&gt;
                  &lt;Id&gt;12M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;1&lt;/Index&gt;
                  &lt;Id&gt;10M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;2&lt;/Index&gt;
                  &lt;Id&gt;8M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;3&lt;/Index&gt;
                  &lt;Id&gt;5M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;4&lt;/Index&gt;
                  &lt;Id&gt;3M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;5&lt;/Index&gt;
                  &lt;Id&gt;2MHD&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;6&lt;/Index&gt;
                  &lt;Id&gt;1.3M&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;7&lt;/Index&gt;
                  &lt;Id&gt;VGA&lt;/Id&gt;
              &lt;/Option&gt;
          &lt;/MenuList&gt;
      &lt;/Item&gt;
      &lt;Item&gt;
          &lt;Cmd&gt;2002&lt;/Cmd&gt;
          &lt;Name&gt;MOVIE_SIZE&lt;/Name&gt;
          &lt;MenuList&gt;
              &lt;Option&gt;
                  &lt;Index&gt;0&lt;/Index&gt;
                  &lt;Id&gt;2880x2160P24&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;1&lt;/Index&gt;
                  &lt;Id&gt;2560x1440P30&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;2&lt;/Index&gt;
                  &lt;Id&gt;2304x1296P30&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;3&lt;/Index&gt;
                  &lt;Id&gt;1920x1080P60&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;4&lt;/Index&gt;
                  &lt;Id&gt;1920x1080P30&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;5&lt;/Index&gt;
                  &lt;Id&gt;1280x720P120&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;6&lt;/Index&gt;
                  &lt;Id&gt;1280x720P60&lt;/Id&gt;
              &lt;/Option&gt;
              &lt;Option&gt;
                  &lt;Index&gt;7&lt;/Index&gt;
                  &lt;Id&gt;1280x720P30&lt;/Id&gt;
              &lt;/Option&gt;
          &lt;/MenuList&gt;
      &lt;/Item&gt;
  &lt;/LIST&gt;
  </code></pre>
  <p>This is my xml i want to convert it Pojo as java object i tried to create online but i dont know what i am doing wrong its showing :
  java.lang.RuntimeException: org.simpleframework.xml.core.ElementException:</p>
  <p>Below class is</p>
  <pre><code> @Root(name = &quot;LIST&quot;)
      public class LicencePlate {
          @Element(name = &quot;LIST&quot;)
          private LIST lIST;
          public LIST getLIST() {
              return lIST;
          }
          public void setLIST(LIST lIST) {
              this.lIST = lIST;
          }
      
          @Override
          public String toString() {
              return &quot;LicencePlate{&quot; +
                      &quot;l
  
  IST=&quot; + lIST +
                  '}';
      }
  }
  
  public class LIST {
      @ElementList(name = &quot;Item&quot;)
      private List&lt;Item&gt; item = new ArrayList&lt;Item&gt;();
      public List&lt;Item&gt; getItem() {
          return item;
      }
      public void setItem(List&lt;Item&gt; item) {
          this.item = item;
      }
  }
  
  
  
  public class Item {
      private List&lt;MenuList&gt; menuList;
      @Element(name = &quot;Cmd&quot;)
      private Integer cmd;
      @Element(name = &quot;Name&quot;)
      private String name;
      public List getMenuList() {
          return menuList;
      }
      public void setMenuList(List menuList) {
          this.menuList = menuList;
      }
      public Integer getCmd() {
          return cmd;
      }
      public void setCmd(Integer cmd) {
          this.cmd = cmd;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  
  public class MenuList {
      @Element(name = &quot;Option&quot;)
      private Option option;
      public Option getOption() {
          return option;
      }
      public void setOption(Option option) {
          this.option = option;
      }
  }
  
  public class Option {
      @Element(name = &quot;Index&quot;)
      private Integer index;
      @Element(name = &quot;Id&quot;)
      private String id;
      public Integer getIndex() {
          return index;
      }
      public void setIndex(Integer index) {
          this.index = index;
      }
      public String getId() {
          return id;
      }
      public void setId(String id) {
          this.id = id;
      }
  }
  </code></pre>
  <p>but when i use i am getting element exception please help me how to create java class fro given xml content.</p>