Ordnance Survey has published a White Paper, part of its Open Source GIS Guide, which references the use of Astun's 'Loader' software. The paper 'A guide to using a pgRouting with OS MasterMap ITN Layer' describes how to load and use the OS MasterMap ITN Layer with pgRouting in a PostGIS database. pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
"To load the ITN Layer data, the recommended approach would be to utilise the free open-source Astun Technology’s Loader script for GML and KML. This uses OGR technology and can be used to load a number of Ordnance Survey data sets into different formats."