title: Android XMLSerializer namespace exception
body: <p>I'm using XMLSerializer to write xml but i keep coming across an exception that doesn't explain much, can you help?</p>
  
  <pre><code>09-25 10:46:31.733: WARN/System.err(23654): java.lang.IllegalArgumentException: &lt;/{}titleid&gt; does not match start
  09-25 10:46:31.944: WARN/System.err(23654):     at org.kxml2.io.KXmlSerializer.endTag(KXmlSerializer.java:504)
  </code></pre>
  
  <p>Exception occurs in the following KXmlSerializer.java</p>
  
  <pre><code>public XmlSerializer endTag(String namespace, String name)
                  throws IOException {
  
              if (!pending)
                  depth--;
              //        if (namespace == null)
              //          namespace = "";
  
              if ((namespace == null &amp;&amp; elementStack[depth * 3] != null)
                      || (namespace != null &amp;&amp; !namespace
                              .equals(elementStack[depth * 3]))
                      || !elementStack[depth * 3 + 2].equals(name))
                  throw new IllegalArgumentException("&lt;/{" + namespace + "}"
                          + name + "&gt; does not match start");
  </code></pre>
  
  <p>any ideas?</p>
  
  <pre><code>private String writeXml(List&lt;Message&gt; messages){
  XmlSerializer serializer = Xml.newSerializer();
  StringWriter writer = new StringWriter();
  try {
      serializer.setOutput(writer);
      serializer.startDocument("UTF-8", true);
      serializer.startTag("", "messages");
      serializer.attribute("", "number", String.valueOf(messages.size()));
      for (Message msg: messages){
          serializer.startTag("", "message");
          serializer.attribute("", "date", msg.getDate());
          serializer.startTag("", "title");
          serializer.text(msg.getTitle());
          serializer.endTag("", "title");
          serializer.startTag("", "url");
          serializer.text(msg.getLink().toExternalForm());
          serializer.endTag("", "url");
          serializer.startTag("", "body");
          serializer.text(msg.getDescription());
          serializer.endTag("", "body");
          serializer.endTag("", "message");
      }
      serializer.endTag("", "messages");
      serializer.endDocument();
      return writer.toString();
  } catch (Exception e) {
      throw new RuntimeException(e);
  } 
  }
  </code></pre>