Format document
More work, still no luck
Implement basic bug script
Add another xml sample file
More code, figured out the problem