Okay this may sound silly, but I am not very familiar with XML.
What I try to do is this:
I have two entities: Company and Employee. Both entities only have a name property.
How would an XML document look like, when I had two companies with each having two employees? Could I simply do something like this? :
<?xml version="1.0"?>
<company>
<name>Apple</name>
<employee>Steve</employee>
<employee>Bill</employee>
</company>
<company>
<name>Banana</name>
<employee>John</employee>
<employee>Luke</employee>
</company>
Is that good syntax? Or must I do it differently then that? Is there missing anything important?
Edit For comparison I copied an valid XML example from USGS (an earthquake watch institute that publishes earthquake data via xml):
<?xml version="1.0"?>
<feed xml:base="http://earthquake.usgs.gov/" xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss">
<updated>2010-01-26T09:36:26Z</updated>
<title>USGS M2.5+ Earthquakes</title>
<subtitle>Real-time, worldwide earthquake list for the past day</subtitle>
<link rel="self" href="/earthquakes/catalogs/1day-M2.5.xml"/>
<link href="http://earthquake.usgs.gov/earthquakes/"/>
<author><name>U.S. Geological Survey</name></author>
<id>http://earthquake.usgs.gov/</id>
<icon>/favicon.ico</icon>
<entry><id>urn:earthquake-usgs-gov:us:2010ryav</id><title>M 5.2, southern Sumatra, Indonesia</title><updated>2010-01-26T06:53:25Z</updated><link rel="alternate" type="text/html" href="/earthquakes/recenteqsww/Quakes/us2010ryav.php"/><summary type="html"><![CDATA[<img src="http://earthquake.usgs.gov/images/globes/0_100.jpg" alt="0.343°S 99.024°E" align="left" hspace="20" /><p>Tuesday, January 26, 2010 06:53:25 UTC<br>Tuesday, January 26, 2010 01:53:25 PM at epicenter</p><p><strong>Depth</strong>: 58.50 km (36.35 mi)</p>]]></summary><georss:point>-0.3427 99.0242</georss:point><georss:elev>-58500</georss:elev><category label="Age" term="Past day"/></entry>
<entry><id>urn:earthquake-usgs-gov:pr:p1002601</id><title>M 2.7, Puerto Rico region</title><updated>2010-01-26T04:14:07Z</updated><link rel="alternate" type="text/html" href="/earthquakes/recenteqsww/Quakes/prp1002601.php"/><summary type="html"><![CDATA[<img src="http://earthquake.usgs.gov/images/globes/20_-65.jpg" alt="19.102°N 66.415°W" align="left" hspace="20" /><p>Tuesday, January 26, 2010 04:14:07 UTC<br>Tuesday, January 26, 2010 12:14:07 AM at epicenter</p><p><strong>Depth</strong>: 13.80 km (8.57 mi)</p>]]></summary><georss:point>19.1017 -66.4150</georss:point><georss:elev>-13800</georss:elev><category label="Age" term="Past day"/></entry>
<entry><id>urn:earthquake-usgs-gov:hv:00036408</id><title>M 3.0, Island of Hawaii, Hawaii</title><updated>2010-01-26T00:37:14Z</updated><link rel="alternate" type="text/html" href="/earthquakes/recenteqsww/Quakes/hv00036408.php"/><summary type="html"><![CDATA[<img src="http://earthquake.usgs.gov/images/globes/20_-155.jpg" alt="19.206°N 155.517°W" align="left" hspace="20" /><p>Tuesday, January 26, 2010 00:37:14 UTC<br>Monday, January 25, 2010 02:37:14 PM at epicenter</p><p><strong>Depth</strong>: 37.70 km (23.43 mi)</p>]]></summary><georss:point>19.2063 -155.5173</georss:point><georss:elev>-37700</georss:elev><category label="Age" term="Past day"/></entry>
</feed>
They use no root element like <entries>
! And Apple's seismicXML example works just fine with this thing. Strange...