Here's something curious: If I try the same thing on <one><two a="1" b="2"/></one> I get the output: <?xml version="1.0"?> <one><two b='2' a='1' /></one> Which shows the childnode. Is it possible we have a problem with newline characters in the buffer? Is this a parser problem or a StringIO problem? -- .tom