That's essentially the standard "would you rather use attributes or
children values" question, since you don't care about the ordering of
the pairs and both are simple strings.
If you think either will eventually want to be divided into
sub-structures, or if you think that other values you add later may want
to consider their order relative to these meaningful, child elements are
probably the way to go. If not, attributes or child text may be a trifle
more human-readable, and are a trifle more compact in the XML text form.
It really boils down to picking the one that reflects how you want code
developers to think about the data. All of these are entirely reasonable:
<pair key="string1" value="string2"/>
<pair><key>string1</key><value>string2</value></pair>
<pair key="string1"><value>string2</value></pair>
<pair key="string1">string2</pair>
(The fact that you need to allow spaces eliminates the option of having
the key be the element name rather than "pair", which I'd otherwise
include in this list.)
Note that this is exactly the same set of decisions you have to make
when designing data structures in a programming languages. Is a given
value a named data field of the object or struct, or is it contained in
another object or struct owned by this one? Or, for that matter, is it
stored somewhere else entirely and just pointed to? All are defensible
decisions, depending on how you want to model the data now, how much you
want that model to agree with other models, and what your plans are for
the future.
--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html
{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."