Adding offset option to allow better control of string ouput formatting in "pretty" mode

When editing a very large XML string, it is not efficient to parse, edit and output the entire string again. It is better to generate a small string with the changed XML and replace only one block in the XML string. However, if the replaced block is not at the root level, the new XML will not have consistent formatting with the existing string. Adding an offset option allows one to generate an XML string that has consistent indentation with the block it is replacing.