You can go two ways:
1. Write an elaborate matching function that scans char by char, comparing to possible char sequences, unless there is a plane type called "Capacity", for instance, where even this will break
2. Enforce proper writing of emails - either enforce XML, or use INI type format:
[THIS IS ANOTHER SECTION]
Type= Cessna Plane
Capacity= 5000
Somevar= Somekey
At any rate, some enforcing of email format is required.
Remember that XML is meta-language, basically. It only prescribes format, not the content, so conversion into XML is entirely up to the data structure that you have. Remember that garbage-in = garbage-out, so if you have properly parsed input values, you can do properly formatted xml, and you write it manually:
Code:
<sectionname>
<plane capacity="$capacity">$type</plane>
</sectionname>
Or
Code:
<sectionname>
<plane>
<type capacity="$capacity">$type</type>
</plane>
</sectionname>
Or
Code:
<sectionname>
<plane>
<type>$type</type>
<capacity>$capacity</capacity>
</plane>
</sectionname>
As you see, the format of XML is entirely up to you. As a general rule, I put numeric values in tag attributes, and strings in tags.