把创建的节点挂到上一节点的最后 找到参考节点,使用insertBefore方法进行插入位置 xml添加属性使用setAttribute方法 转载于:https://www.cnblogs.com/qingyundian/p/8486550.html