title: Convert SimpleXML to DOMDocument, not DOMElement
body: <p>I need to convert a <code>SimpleXML</code> object to a <code>DOMDocument</code>, to use it with <code>DOMXPath</code>. I need DOMXPath so that I can use its <code>registerPHPFunctions</code> method. Can this be done?</p>
  
  <p>With <code>dom_import_simplexml</code> I get a <code>DOMElement</code>, not <code>DOMDocument</code>.</p>