title: PHP XML DOM getElementById
body: <p>I need to pick one tag from xml file and insert another tag before this tag. I'm doing this with method <code>insertBefore</code> in DOM, but the problem is, that if I want pick the tag before I want to add the another tag by method <code>getElementById</code>, it doesn't work.<br>
  It writes "using non-object". This is how the tag looks:</p>
  
  <pre><code>&lt;item id="Flow_0" href="Flow_0.html" media-type="application/xhtml+xml"/&gt;
  </code></pre>
  
  <p>Somewhere I read that it must look like this, but I can't edit all files:</p>
  
  <pre><code>&lt;item xml:id="Flow_0" href="Flow_0.html" media-type="application/xhtml+xml"/&gt;
  </code></pre>
  
  <p>Have you got any idea how to do that?</p>