Composting a humanure mix in sealed enclosures with a regulated exhaust would produce relatively high nitrogen compost. Deliver this locally to growing crops in a just-in-time manner for less nitrogen loss. However, it's hard to see this happening on any meaningful scale, with regard to the current trajectory of modern civilization, especially in the cities.