updating ofXml a bit, adding error handing in loadFromBuffer, and creating an example