How to generate following xml

Posted by Mohsan on Stack Overflow See other posts from Stack Overflow or by Mohsan
Published on 2010-06-14T13:54:45Z Indexed on 2010/06/15 6:02 UTC
Read the original article Hit count: 418

Filed under:
|

hi. i want to generate XML for the following tree type structure. i attached picture. generated xml should be

 <services>
  <service>
    <name>Service 1</name>
    <categories>
      <category>
        <name>Cateogry 1</name>
        <methods>
          <method>
            <name>Method 1</name>
          </method>
        </methods>
      </category>
    </categories>
  </service>
  <service>
    <name>Service 2</name>
    <categories>
      <category>
        <name>Cateogry 1</name>
        <methods>
          <method>
            <name>Method 1</name>
          </method>
        </methods>
      </category>
    </categories>
  </service>
  <service>
    <name>Service 3</name>
    <categories>
      <category>
        <name>Cateogry 1</name>
        <methods>
          <method>
            <name>Method 1</name>
          </method>
        </methods>
      </category>
    </categories>
  </service>
</services>

Tree Image

© Stack Overflow or respective owner

Related posts about Xml

Related posts about linq-to-xml