Magento 2: Add after/before positioning in pre existing xml block/container

<move element="checkout.cart.shipping" destination="cart.summary" before="-"/>

This link helps me.

how to change block ordering in layouts


You can use move tags to move blocks. <move> instruction: allows changing element's order and parent.

<move element="logo" destination="login.header" before="-"/>

element: name of the current block/container.

destination: name of the destination block/container where you moving element.

before: name of the block before which you need to move your block.

after: name of the block after which you need to move your block.

Refer this for more information: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html