Long story short - I had a need to add this code because an upstream change broke this test - trying to figure out what the issue was a bit mind numbing... My python skills are fairly basic... Anyway, after a bit of searching this morning I have a better way:

``` 
           elems = map(None, pre_xml.splitlines(),after_xml.splitlines())
            for pre_line, aft_line in elems:
                if pre_line.lstrip().strip() != aft_line.lstrip().strip():
                    if pre_line != None:
                        logging.debug("diff before='%s'", pre_line.lstrip().strip())
                    if aft_line != None:
                        logging.debug("diff  after='%s'", aft_line.lstrip().strip())
            raise error.TestFail("Failed xml before/after comparison")
```

This would result in output such as:
```
10:07:38 DEBUG| diff before='<source dev='/home/virt-test2/shared/data/images/jeos-19-64.snap2'/>'
10:07:38 DEBUG| diff  after='<source file='/home/virt-test2/shared/data/images/jeos-19-64.new-name'/>'
```
BTW: That was the bug - printing 'dev' instead of 'file' (since fixed)

I also tested using sample strings:
```
python
>>>foo="abc\ndef\nhij\nkln\nopq\n"
>>>fie="abc\ndee\nhij\nklm\n"
>>> elems = map(None, foo.splitlines(), fie.splitlines())
>>> for line1,line2 in elems:
...     if line1 != line2:
...         if line1 != None: print line1
...         if line2 != None: print line2
... 
def
dee
kln
klm
opq
```