title: How to have an XML tag start with a number?
body: <p>I'm using ElementTree API to read and write to an XML document. When I try to add a tag that starts with a number, the XML file is no longer valid. Using <code>import xml.etree.cElementTree as ET</code>, I am successfully able to create the XML document, but when I try to read in the XML file again, I get a ParseError. For my purposes, it does not matter if the XML document is not well formed. <strong>I just need to be able to start a tag with a number.</strong> Any idea how to do this? </p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>from lxml import etree
  parser = etree.XMLParser(recover=True)
  tree = ET.parse('xmldoc.xml')
  root = tree.getroot()
  xmlstring = ET.tostring(root)
  etree.fromstring(xmlstring, parser=parser)
  </code></pre>
  
  <p>If I use this, I get this error:</p>
  
  <blockquote>
    <p>ValueError: Invalid tag name u'1.0'</p>
  </blockquote>
  
  <p>after trying to do this:</p>
  
  <pre><code>            inputowner = raw_input("Enter owner for " + ls[i] + ": ")
              child = ET.SubElement(prev , ls[i], owner = inputowner)
              prev = child
              prevowner = inputowner
  </code></pre>
  
  <p>Here is the list I am trying to put into an XML file:</p>
  
  <pre><code>['components', 'rel', 'core.slpi', '1.0', 'blluuses', 'i2c', 'src', 'logs', 'I2cUlog.c']
  </code></pre>
  
  <p>Each item in the list should be used as the ElementTree tag. The problem arises when I reach '1.0'. </p>
  
  <p>If unable to answer first question, do you know of any other module that will do virtually the same thing but allow me have a tag that starts with a number? ElementTree is fantastic, I just need this one thing to work and then I can move on. </p>