title: php parse xml - error: StartTag: invalid element name
body: <p>I have a serious problem with getting data from a sql query in php into an xml. I always get the error: <code>StartTag: invalid element name. The Start-Element is a Number</code>, I dont know if that matters?!?</p>
  
  <p>Maybe you guys can help me!!</p>
  
  <p>PHP:</p>
  
  <pre><code>$query = "SELECT r.object_id,
  t.term_taxonomy_id,
  t.term_id,
  t.taxonomy,
  t.description,
  p.post_date_gmt,
  p.post_content,
  p.post_title,
  p.post_excerpt 
  FROM wp_posts p,
  wp_term_taxonomy t,
  wp_term_relationships r
  WHERE r.object_id= p.id
  AND t.term_taxonomy_id = r.term_taxonomy_id
  AND p.post_status = 'publish'
  AND p.post_type = 'post'
  AND to_days(p.post_date_gmt) &gt;= to_days(now()) - 120
  ORDER BY p.post_date DESC";
  
  
  // DB Connect
  
  $connection = mysql_connect($server, $user, $password);
  mysql_select_db($dbName, $connection);
  $res = mysql_query($query);
  
  // XML Output
  
  $xml = '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;standing version="1.0"&gt;';
  while ($row = mysql_fetch_assoc($res)){
      $xml .= '
      &lt;'.$row['object_id'].'&gt;
        &lt;term_taxonomy&gt;'.$row['taxonomy'].'&lt;/term_taxonomy&gt;
        &lt;description&gt;'.$row['description'].'&lt;/description&gt;
        &lt;post_date&gt;'.$row['post_date_gmt'].'&lt;/post_date&gt;
        &lt;post_content&gt;'.$row['post_content'].'&lt;/post_content&gt;
        &lt;post_title&gt;'.$row['post_title'].'&lt;/pst_title&gt;
        &lt;post_exerpt&gt;'.$row['post_exerpt'].'&lt;/post_exerpt&gt;
      &lt;/'.$row['object_id'].'&gt;
      ';
  }
  $xml.= '&lt;/standing&gt;';
  
  
  // Write to file
  
  $file = 'News.xml'; 
  if(is_file($file)) unlink($file);
  $fp = fopen($file, "w+");
  fwrite($fp, $xml);
  fclose($fp);
  mysql_close ($connection);
  ?&gt;
  </code></pre>