title: How to include the namespaces into a xml file using lxml?
body: <p>I am creating a new xml file from scratch using python and the lxml library.</p>
  
  <pre><code>&lt;route xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.xxxx" version="1.1"
  xmlns:stm="http://xxxx/1/0/0"
  xsi:schemaLocation="http://xxxx/1/0/0 stm_extensions.xsd"&gt;
  </code></pre>
  
  <p>I need to include this namespace information into the root tag as attributes of the route tag. </p>
  
  <p>I can´t include the information into the root declaration.</p>
  
  <pre><code>from lxml import etree
  root = etree.Element("route",
      xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance",
      xmlns = "http://www.xxxxx",
      version = "1.1",
      xmlns: stm = "http://xxxxx/1/0/0"
  )
  </code></pre>
  
  <p>there is a SyntaxError: invalid syntax</p>
  
  <p>How can I do that ?</p>