Fix for issue #8, this version correctly serializes xml on mono platform

Hi Anash,
im sorry but your solution for issue #8 is not working under mono. As i noted i believe it is partly mono who is wrong (described in mentioned issue #8), but I as well believe that my solution is better suited for task. I have it tested under mono and been using it from my fork for a while.
Would be nice if you can merge into 16.8., so we can use nuget package once again.

Thank you!