xml转Json中遇到了的一些问题?如何将有动态行的xml 转换成JSon



```xml
<?xml version="1.0" encoding="UTF-8"?>
<ApproveDataInfo>
  <Region>1</Region>
  <BusinessInfo>
      <ApplyInfo>
        <ProjectNo>1</ProjectNo>
        <CatalogCode>002018009000</CatalogCode>
        <TaskCode>1</TaskCode>
        <TaskHandleItem>1</TaskHandleItem>
        <TaskName>1</TaskName>
        <ApplyerName>1</ApplyerName>
        <ApplyerType>2</ApplyerType>
        <ApplyerPageType>1</ApplyerPageType>
        <ApplyerPageCode>1</ApplyerPageCode>
        <Legal>1</Legal>
        <ContactName>1</ContactName>
        <ContactType>001.1</ContactType>
        <ContactCode>1</ContactCode>
        <ContactMobile>1</ContactMobile>
        <Address>1</Address>
        <ApplyDate>2017-11-02 20:02:30</ApplyDate>
        <ApplyType>2.1</ApplyType>
        <DeliverType>0.1</DeliverType>
        <FormData> 
           <--主键-->
           <ID>ID</ID>
           <--主键值-->
           <idValue>1</idValue>
          <AutoTable id=""1"" name=""表名"">
          <AutoRow> 
           <--申请业务-->
             <TaskName>1</TaskName>
           <--业务名称-->    
             <TaskValue>1</TaskValue>
         </AutoRow>
        </AutoTable>
         <AutoDiv name=""2"" id=""动态区域ID"">
           <--申请等级-->
             <Qualilevel>1</Qualilevel>
           <--申报等级-->
             <QualilevelValue>1</QualilevelValue>
         </AutoDiv>
        </FormData>
        <ProjectType>2.1</ProjectType>
        <SystemNo>1</SystemNo>
      </ApplyInfo>
      <AcceptInfo/>
  </BusinessInfo>
  <ProcessInfo/>
  <SpecialApply/>
  <SpecialResult/>
  <FinishInfo/>
</ApproveDataInfo>

```

有两种方法,请参考这篇文章https://blog.csdn.net/qq_35893120/article/details/84248010,如有帮助请采纳!

    String xml = "<xml><a>a</a><b>b</b></xml>";
    JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(XML.toJSONObject(xml)));