Please be aware that more is needed to get all the the correct xmlns references, that's why we have serialize in current master (and similar code in OL2)