from mod_python import apache from xml.dom.minidom import getDOMImplementation, parse, parseString import os import urllib def index(req): req.content_type = "text/xml" doc2 = parse(urllib.urlopen("http://www.yr.no/place/Finland/Southern_Finland/Helsinki/forecast.xml")) impl = getDOMImplementation() doc = impl.createDocument("http://www.w3.org/1999/xhtml", "table", None) doc.documentElement.setAttribute("xmlns", "http://www.w3.org/1999/xhtml") req.write( doc2.toxml("ISO-8859-1") )