I have object, tree/model/hierarchy, whatever the correct term is. It consists of what could be characterized as a one-to-one mapping of the desired XML.
That is i have the following (in a non-standard UML sort of syntax)
class A {
class B b[*]
class C
class D
}
class B {
class C c[*]
string AttributeFoo = "bar"
}
class C {
string AttributeThis = "is"
}
class D {
string AttributeName = "d"
}
Desired output is something like this:
<?xml version="1.0"?>
<a>
<b attribute-foo="bar">
<c attribute-this="is"/>
</b>
<c attribute-this="is"/>
<d attribute-name="d"/>
</a>
What would you propose to be the best, and/or the simplest way of achieving this goal?