Tried to decouple the rexml/print portion of code from the rest