Blender.Load + Render Problem !?

hi ! i´m working with the SPE on a python script which parses an xml and gives info to blender and lets it render.

in SPE everything runs fine but if i want tu run the script in blender directly i get error messages when i have the blend file not opened before runnin the script.

if i load the blend file before and then run th e script everything is cool!

it seems it lays on the Blender.Load in combination with FromXmlParser !

anyone an idea?

here the scrap of the code:

import Blender
from Blender import Scene
from Blender.Scene import Render
from xml.dom.ext.reader.Sax2 import FromXmlStream

doc = FromXmlStream("c:/go.xml")
Blender.Load("C:/2.blend")

def paul(e,x,y):
      for element in doc.getElementsByTagName("name"):

i think it could also be the position of the Blender.Load().

as i read in the API it should be at the end of the script because all the settings before get lost.
so where should i put ( because at the end it doesn´t work too) ?

if i use 2 scripts where the first just starts the other i get an error that an other py is runnin !?

PLZ HELP



import Blender
from Blender import Scene
from Blender.Scene import Render
from xml.dom.ext.reader.Sax2 import FromXmlStream
doc = FromXmlStream("c:/test.xml")

def paul():
    for element in doc.getElementsByTagName("name"):
        element.normalize()

        if element.firstChild.data == "Walther":
            scn=Scene.getCurrent()
            print scn.getName()
            scn.setLayers([2])
            context = scn.getRenderingContext()
            Blender.Set('curframe',500)
            context.setRenderPath("C:/tmp")
            context.render()

paul()
Blender.Load("C:/test.blend")