build xml with ox

May be my changes will be interesting for you:

i moved library dependent code that builds xml data into one place,
changed syntax for building xml to library independent and used fast xml library ox

I marked with "TODO xml builder" places where i did not change old code.